pub trait SourceBytes {
// Required methods
fn window(
&mut self,
start: u64,
len: usize,
) -> Result<ByteWindow<'_>, Diagnostic>;
fn len_hint(&self) -> Option<u64>;
}Expand description
Random-access bytes exposed through bounded, borrow-stable windows.
Required Methods§
Sourcefn window(
&mut self,
start: u64,
len: usize,
) -> Result<ByteWindow<'_>, Diagnostic>
fn window( &mut self, start: u64, len: usize, ) -> Result<ByteWindow<'_>, Diagnostic>
Returns at most len bytes starting at the global byte offset start.
§Errors
Returns a registered resource, budget, or addressability diagnostic.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".