pub trait ReadableBytes: Debug {
// Required methods
fn len(&self) -> u64;
fn read_at(
&self,
offset: u64,
target: &mut [u8],
) -> Result<(), ByteAccessError>;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn as_contiguous(&self) -> Option<&[u8]> { ... }
}Expand description
Bounded readable bytes exposed by a transport implementation.
Implementations may be segmented. Every operation is nonblocking and allocation-free.
Required Methods§
Provided Methods§
Sourcefn as_contiguous(&self) -> Option<&[u8]>
fn as_contiguous(&self) -> Option<&[u8]>
Borrow the complete source when the concrete mapping is contiguous and stable.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".