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>
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
impl SourceSize for &Empty
fn upper_bound(&self) -> Option<u64>
Source§impl SourceSize for &File
Available on Unix or WASI or Windows only.
impl SourceSize for &File
Available on Unix or WASI or Windows only.
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 Empty
impl SourceSize for Empty
fn upper_bound(&self) -> Option<u64>
Source§impl SourceSize for File
Available on Unix or WASI or Windows only.
impl SourceSize for File
Available on Unix or WASI or Windows only.
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.