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§
fn lower_bound(&self) -> u64
fn upper_bound(&self) -> Option<u64>
Implementations on Foreign Types§
Source§impl SourceSize for &File
Available on Unix or Windows or WASI only.
impl SourceSize for &File
Available on Unix or Windows or WASI only.
fn upper_bound(&self) -> Option<u64>
Source§impl SourceSize for &Empty
impl SourceSize for &Empty
fn upper_bound(&self) -> Option<u64>
Source§impl SourceSize for &[u8]
impl SourceSize for &[u8]
fn lower_bound(&self) -> u64
fn upper_bound(&self) -> Option<u64>
Source§impl SourceSize for VecDeque<u8>
impl SourceSize for VecDeque<u8>
fn lower_bound(&self) -> u64
fn upper_bound(&self) -> Option<u64>
Source§impl SourceSize for Vec<u8>
Available on crate feature alloc only.
impl SourceSize for Vec<u8>
Available on crate feature
alloc only.fn lower_bound(&self) -> u64
fn upper_bound(&self) -> Option<u64>
Source§impl SourceSize for File
Available on Unix or Windows or WASI only.
impl SourceSize for File
Available on Unix or Windows or WASI only.