Skip to main content

DeserializableTraceData

Trait DeserializableTraceData 

Source
pub trait DeserializableTraceData: TraceData {
    // Required methods
    fn get_mut_slice(buf: &mut Self::Bytes) -> &mut &'static [u8] ;
    fn try_slice_and_advance(
        buf: &mut Self::Bytes,
        bytes: usize,
    ) -> Option<Self::Bytes>;
    fn read_string(buf: &mut Self::Bytes) -> Result<Self::Text, DecodeError>;
    fn intern_skipped_str(owner: &Self::Bytes, s: &'static str) -> Self::Text;
}

Required Methods§

Source

fn get_mut_slice(buf: &mut Self::Bytes) -> &mut &'static [u8]

Source

fn try_slice_and_advance( buf: &mut Self::Bytes, bytes: usize, ) -> Option<Self::Bytes>

Source

fn read_string(buf: &mut Self::Bytes) -> Result<Self::Text, DecodeError>

Source

fn intern_skipped_str(owner: &Self::Bytes, s: &'static str) -> Self::Text

Interns a string found while walking a value through get_mut_slice’s lied 'static view (e.g. skipping an unrecognized V1 field for forward compatibility). s really borrows from owner’s memory, not 'static: implementations must derive Self::Text from owner itself rather than trusting that lifetime, so a refcounted backing allocation isn’t freed out from under the interned string.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§