Trait PFields

pub trait PFields: Debug {
    // Required methods
    fn parts(&self) -> PFieldsParts<'_> ;
    fn data(&self) -> &[u8] ;
    fn tail(&self) -> Option<Tail<'_>>;
    fn padding(&self) -> &[u8] ;
    fn linkpoint_header(&self) -> Option<&LinkPointHeader>;
    fn signed(&self) -> Option<&Signed>;
    fn pfields_segments(&self) -> ByteSegments<'_>;
    fn fields_header_ref(&self) -> &PFieldsHeader;
}
Expand description

General trait for accessing point field.

Fields are included in LkHash.

Various fields are accessed through [PFieldsExt]

Impl’ed by [[PFieldsPtr]] and [[PFieldsParts]] [[PFieldsPtr]] impls is a byte layout [[PFieldsParts]] impl is a rusty enum repr

Required Methods§

fn parts(&self) -> PFieldsParts<'_>

The rusty enum repr of a point.

fn data(&self) -> &[u8]

fn tail(&self) -> Option<Tail<'_>>

fn padding(&self) -> &[u8]

Points are padded with upto 7 \xFF bytes and are u64 aligned - this is accessible here for completeness sake.

fn linkpoint_header(&self) -> Option<&LinkPointHeader>

Return a LinkPFieldsHeader, works for both key and link points.

fn signed(&self) -> Option<&Signed>

fn pfields_segments(&self) -> ByteSegments<'_>

A utility function to translate this format into bytes for hashing & io

fn fields_header_ref(&self) -> &PFieldsHeader

Implementors§

§

impl PFields for PFieldsPtr

§

impl PFields for PFieldsThinPtr

§

impl<'tail> PFields for PFieldsParts<'tail>

§

impl<T> PFields for T
where T: PointExt,