pub trait Octets: AsRef<[u8]> {
type Range<'a>: Octets
where Self: 'a;
// Required method
fn range(&self, range: impl RangeBounds<usize>) -> Self::Range<'_>;
}
Expand description
A type representing an octets sequence.
The primary purpose of the trait is to allow access to a sub-sequence,
called a ‘range.’ The type of this range is given via the Range
associated type. For most types it will be a &[u8]
with a lifetime
equal to that of a reference. Only if an owned range can be created
cheaply, it should be that type.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.