Skip to main content

SourceSize

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§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl SourceSize for &Empty

Source§

impl SourceSize for &File

Available on Unix or WASI or Windows only.
Source§

impl SourceSize for &[u8]

Source§

impl SourceSize for Empty

Source§

impl SourceSize for File

Available on Unix or WASI or Windows only.
Source§

impl SourceSize for Vec<u8>

Available on crate feature alloc only.
Source§

impl SourceSize for VecDeque<u8>

Source§

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

Source§

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

Source§

impl<T> SourceSize for Take<T>

Implementors§