Skip to main content

SourceBytes

Trait SourceBytes 

Source
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§

Source

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.

Source

fn len_hint(&self) -> Option<u64>

Exact source length when known without consuming the source.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§