pub(super) struct Buffer {
buf: Box<[MaybeUninit<u8>]>,
pos: usize,
filled: usize,
initialized: bool,
}🔬This is a nightly-only experimental API. (
alloc_io #154046)Fields§
§buf: Box<[MaybeUninit<u8>]>🔬This is a nightly-only experimental API. (
§alloc_io #154046)pos: usize🔬This is a nightly-only experimental API. (
§alloc_io #154046)filled: usize🔬This is a nightly-only experimental API. (
§alloc_io #154046)initialized: bool🔬This is a nightly-only experimental API. (
alloc_io #154046)Implementations§
Source§impl Buffer
impl Buffer
pub(super) fn with_capacity(capacity: usize) -> Self
🔬This is a nightly-only experimental API. (
alloc_io #154046)pub(super) fn try_with_capacity(capacity: usize) -> Result<Self>
🔬This is a nightly-only experimental API. (
alloc_io #154046)pub(super) fn buffer(&self) -> &[u8] ⓘ
🔬This is a nightly-only experimental API. (
alloc_io #154046)pub(super) fn capacity(&self) -> usize
🔬This is a nightly-only experimental API. (
alloc_io #154046)pub(super) fn filled(&self) -> usize
🔬This is a nightly-only experimental API. (
alloc_io #154046)pub(super) fn pos(&self) -> usize
🔬This is a nightly-only experimental API. (
alloc_io #154046)pub(super) fn initialized(&self) -> bool
🔬This is a nightly-only experimental API. (
alloc_io #154046)pub(super) fn discard_buffer(&mut self)
🔬This is a nightly-only experimental API. (
alloc_io #154046)pub(super) fn consume(&mut self, amt: usize)
🔬This is a nightly-only experimental API. (
alloc_io #154046)Sourcepub(super) fn consume_with<V>(&mut self, amt: usize, visitor: V) -> bool
🔬This is a nightly-only experimental API. (alloc_io #154046)
pub(super) fn consume_with<V>(&mut self, amt: usize, visitor: V) -> bool
alloc_io #154046)If there are amt bytes available in the buffer, pass a slice containing those bytes to
visitor and return true. If there are not enough bytes available, return false.
pub(super) fn unconsume(&mut self, amt: usize)
🔬This is a nightly-only experimental API. (
alloc_io #154046)Sourcepub(super) fn read_more(&mut self, reader: impl Read) -> Result<usize>
🔬This is a nightly-only experimental API. (alloc_io #154046)
pub(super) fn read_more(&mut self, reader: impl Read) -> Result<usize>
alloc_io #154046)Read more bytes into the buffer without discarding any of its contents
Sourcepub(super) fn backshift(&mut self)
🔬This is a nightly-only experimental API. (alloc_io #154046)
pub(super) fn backshift(&mut self)
alloc_io #154046)Remove bytes that have already been read from the buffer.
pub(super) fn fill_buf(&mut self, reader: impl Read) -> Result<&[u8]>
🔬This is a nightly-only experimental API. (
alloc_io #154046)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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> SizeHint for Twhere
T: ?Sized,
impl<T> SizeHint for Twhere
T: ?Sized,
Source§default fn lower_bound(&self) -> usize
default fn lower_bound(&self) -> usize
🔬This is a nightly-only experimental API. (
core_io_internals)Returns a lower bound on the number of elements this container-like item
contains.
For example, an array
[u8; 12] could return any value between 0 and
12 inclusively as a correct implementation. Read moreSource§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize = _
#[doc(hidden)]const SIZE: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize = _
#[doc(hidden)]const ALIGN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment = _
#[doc(hidden)]const ALIGNMENT: Alignment = _
🔬This is a nightly-only experimental API. (
ptr_alignment_type #102070)Source§#[doc(hidden)]const IS_ZST: bool = _
#[doc(hidden)]const IS_ZST: bool = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout = _
#[doc(hidden)]const LAYOUT: Layout = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize = _
#[doc(hidden)]const MAX_SLICE_LEN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)The largest safe length for a
[Self]. Read more