Struct SizeHint
struct SizeHint { ... }
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: &Self) -> u64Returns the lower bound of data that the
Bodywill yield before completing.fn set_lower(self: &mut Self, value: u64)Set the value of the
lowerhint.Panics
The function panics if
valueis greater thanupper.fn upper(self: &Self) -> Option<u64>Returns the upper bound of data the
Bodywill yield before completing, orNoneif the value is unknown.fn set_upper(self: &mut Self, value: u64)Set the value of the
upperhint value.Panics
This function panics if
valueis less thanlower.fn exact(self: &Self) -> Option<u64>Returns the exact size of data that will be yielded if the
lowerandupperbounds are equal.fn set_exact(self: &mut Self, value: u64)Set the value of the
lowerandupperbounds to exactly the same.
impl Clone for SizeHint
fn clone(self: &Self) -> SizeHint
impl Debug for SizeHint
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Default for SizeHint
fn default() -> SizeHint
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
impl<T> Any for SizeHint
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for SizeHint
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for SizeHint
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for SizeHint
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for SizeHint
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for SizeHint
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for SizeHint
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for SizeHint
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for SizeHint
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>