Trait SourceSize

Source
pub unsafe trait SourceSize {
    // Provided methods
    fn lower_bound(&self) -> u64 { ... }
    fn upper_bound(&self) -> Option<u64> { ... }
}
Expand description

A trait which gives known upper and lower bounds of the size of the source.

§Safety

Other functions rely on these bounds being correct. The source must produce at least the number of bytes returned by lower_bound, and at most that returned by upper_bound.

Provided Methods§

Implementations on Foreign Types§

Source§

impl SourceSize for &File

Source§

impl SourceSize for &Empty

Source§

impl SourceSize for &[u8]

Source§

impl SourceSize for VecDeque<u8>

Source§

impl SourceSize for Vec<u8>

Source§

impl SourceSize for File

Source§

impl SourceSize for Empty

Source§

impl<R: Read + SourceSize + ?Sized> SourceSize for BufReader<R>

Source§

impl<T> SourceSize for Take<T>

Source§

impl<T: AsRef<[u8]>> SourceSize for Cursor<T>

Implementors§