Struct SizeHint

struct SizeHint { ... }

A Body size hint

The default implementation returns:

Implementations

impl SizeHint

fn new() -> SizeHint

Returns a new SizeHint with default values

fn with_exact(value: u64) -> SizeHint

Returns a new SizeHint with both upper and lower bounds set to the given value.

fn lower(self: &Self) -> u64

Returns the lower bound of data that the Body will yield before completing.

fn set_lower(self: &mut Self, value: u64)

Set the value of the lower hint.

Panics

The function panics if value is greater than upper.

fn upper(self: &Self) -> Option<u64>

Returns the upper bound of data the Body will yield before completing, or None if the value is unknown.

fn set_upper(self: &mut Self, value: u64)

Set the value of the upper hint value.

Panics

This function panics if value is less than lower.

fn exact(self: &Self) -> Option<u64>

Returns the exact size of data that will be yielded if the lower and upper bounds are equal.

fn set_exact(self: &mut Self, value: u64)

Set the value of the lower and upper bounds 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) -> T

Returns the argument unchanged.

impl<T> ToOwned for SizeHint

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for SizeHint

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses 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>