pub trait Message:
Eq
+ PartialEq
+ Sized
+ Send
+ Sync
+ Hash
+ Copy
+ Clone
+ 'static {
type IdType: Display + Ord + Send + Sized + Copy + Clone;
// Required methods
fn id(&self) -> Self::IdType;
fn offset(&self) -> u64;
fn encode_to(&self, dest: MutPtrByteSlice<'_>);
fn decode_from(src: PtrByteSlice<'_>) -> Self;
fn is_zeroes(&self) -> bool;
// Provided methods
fn is_open_marker(&self) -> bool { ... }
fn encode_to_vmo(
messages: impl IntoIterator<Item = impl Borrow<Self>>,
block_size: usize,
) -> Result<Vmo, Status> { ... }
fn decode_from_vmo(
vmo: Vmo,
block_size: usize,
) -> Result<DecodedMessageIter<Self>, Status> { ... }
}Expand description
A fixed-size profile entry recording an access to (id, offset).
Required Associated Types§
Required Methods§
fn id(&self) -> Self::IdType
fn offset(&self) -> u64
fn encode_to(&self, dest: MutPtrByteSlice<'_>)
fn decode_from(src: PtrByteSlice<'_>) -> Self
fn is_zeroes(&self) -> bool
Provided Methods§
fn is_open_marker(&self) -> bool
Sourcefn encode_to_vmo(
messages: impl IntoIterator<Item = impl Borrow<Self>>,
block_size: usize,
) -> Result<Vmo, Status>
fn encode_to_vmo( messages: impl IntoIterator<Item = impl Borrow<Self>>, block_size: usize, ) -> Result<Vmo, Status>
Encodes messages into a new zx::Vmo packed into block_size-aligned blocks (typically
4 KiB) without crossing block_size boundaries. Any trailing bytes in a block that cannot
fit a full message are zero-padded.
Sourcefn decode_from_vmo(
vmo: Vmo,
block_size: usize,
) -> Result<DecodedMessageIter<Self>, Status>
fn decode_from_vmo( vmo: Vmo, block_size: usize, ) -> Result<DecodedMessageIter<Self>, Status>
Returns an iterator that lazily decodes messages from vmo one block_size-aligned block
at a time. An all-zero message (Self::is_zeroes()) marks the end of the recorded stream.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".