Struct SizeHint
pub struct SizeHint { /* private fields */ }
A Body size hint
The default implementation returns:
- 0 for
lower Noneforupper.
Implementations
impl SizeHint
fn new() -> SizeHintReturns a new
SizeHintwith default valuesfn with_exact(value: u64) -> SizeHintReturns a new
SizeHintwith both upper and lower bounds set to the given value.fn lower(&self) -> u64Returns the lower bound of data that the
Bodywill yield before completing.fn set_lower(&mut self, value: u64)Set the value of the
lowerhint.Panics
The function panics if
valueis greater thanupper.fn upper(&self) -> Option<u64>Returns the upper bound of data the
Bodywill yield before completing, orNoneif the value is unknown.fn set_upper(&mut self, value: u64)Set the value of the
upperhint value.Panics
This function panics if
valueis less thanlower.fn exact(&self) -> Option<u64>Returns the exact size of data that will be yielded if the
lowerandupperbounds are equal.fn set_exact(&mut self, value: u64)Set the value of the
lowerandupperbounds to exactly the same.
Trait Implementations
impl Add for SizeHint
type Output = SizeHint;fn add(self, rhs: Self) -> Self::Output
impl Clone for SizeHint
fn clone(&self) -> SizeHint
impl Copy for SizeHint
impl Debug for SizeHint
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for SizeHint
fn default() -> SizeHint
Auto Trait Implementations
impl Freeze for SizeHint
impl RefUnwindSafe for SizeHint
impl Send for SizeHint
impl Sync for SizeHint
impl Unpin for SizeHint
impl UnsafeUnpin for SizeHint
impl UnwindSafe for SizeHint
Blanket Implementations
impl<T> Any for SizeHint
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for SizeHint
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for SizeHint
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for SizeHint
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for SizeHint
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for SizeHint
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for SizeHint
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 SizeHint
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for SizeHint
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>