#[non_exhaustive]pub struct Take<T> { /* private fields */ }🔬This is a nightly-only experimental API. (
core_io #154046)Expand description
Implementations§
Source§impl<T> Take<T>
impl<T> Take<T>
1.0.0 · Sourcepub fn limit(&self) -> u64
pub fn limit(&self) -> u64
Sourcepub fn position(&self) -> u64
🔬This is a nightly-only experimental API. (seek_io_take_position #97227)
pub fn position(&self) -> u64
seek_io_take_position #97227)Returns the number of bytes read so far.
1.27.0 · Sourcepub fn set_limit(&mut self, limit: u64)
pub fn set_limit(&mut self, limit: u64)
Sets the number of bytes that can be read before this instance will
return EOF. This is the same as constructing a new Take instance, so
the amount of bytes read and the previous limit value don’t matter when
calling this method.
§Examples
1.15.0 · Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes the Take, returning the wrapped reader.
§Examples
1.20.0 · Sourcepub fn get_ref(&self) -> &T
pub fn get_ref(&self) -> &T
Gets a reference to the underlying reader.
Care should be taken to avoid modifying the internal I/O state of the
underlying reader as doing so may corrupt the internal limit of this
Take.
§Examples
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Take<T>where
T: Freeze,
impl<T> RefUnwindSafe for Take<T>where
T: RefUnwindSafe,
impl<T> Send for Take<T>where
T: Send,
impl<T> Sync for Take<T>where
T: Sync,
impl<T> Unpin for Take<T>where
T: Unpin,
impl<T> UnsafeUnpin for Take<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Take<T>where
T: UnwindSafe,
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