Struct Buffer
pub(in ::io::buffered::bufreader) struct Buffer { pub(in ::io::buffered::bufreader::buffer) buf: Box<[MaybeUninit<u8>]>, pub(in ::io::buffered::bufreader::buffer) pos: usize, pub(in ::io::buffered::bufreader::buffer) filled: usize, pub(in ::io::buffered::bufreader::buffer) initialized: bool }
Fields
buf: Box<[MaybeUninit<u8>]>pos: usizefilled: usizeinitialized: bool
Implementations
impl Buffer
fn with_capacity(capacity: usize) -> Selffn try_with_capacity(capacity: usize) -> Result<Self>fn buffer(&self) -> &[u8]fn capacity(&self) -> usizefn filled(&self) -> usizefn pos(&self) -> usizefn initialized(&self) -> boolfn discard_buffer(&mut self)fn consume(&mut self, amt: usize)fn consume_with<V>(&mut self, amt: usize, visitor: V) -> bool where V: FnMut(&[u8]),If there are
amtbytes available in the buffer, pass a slice containing those bytes tovisitorand return true. If there are not enough bytes available, return false.fn unconsume(&mut self, amt: usize)fn read_more(&mut self, reader: impl Read) -> Result<usize>Read more bytes into the buffer without discarding any of its contents
fn backshift(&mut self)Remove bytes that have already been read from the buffer.
fn fill_buf(&mut self, reader: impl Read) -> Result<&[u8]>
Auto Trait Implementations
impl Freeze for Buffer
impl RefUnwindSafe for Buffer
impl Send for Buffer
impl Sync for Buffer
impl Unpin for Buffer
impl UnsafeUnpin for Buffer
impl UnwindSafe for Buffer
Blanket Implementations
impl<T> Any for Buffer
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Buffer
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Buffer
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for Buffer
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for Buffer
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for Buffer
impl<T, U> Into<U> for Buffer
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Buffer
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for Buffer
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>