Skip to main content

ECGHeader

Trait ECGHeader 

Source
pub trait ECGHeader {
    type HeaderId: Ord + Copy + Debug;

    // Required methods
    fn get_parent_ids(&self) -> &[Self::HeaderId];
    fn get_header_id(&self) -> Self::HeaderId;
    fn validate_header(&self, header_id: Self::HeaderId) -> bool;
}
Expand description

Trait that ECG headers (nodes?) must implement.

Required Associated Types§

Required Methods§

Source

fn get_parent_ids(&self) -> &[Self::HeaderId]

Return the parents ids of a node. If an empty slice is returned, the root node is the parent.

Source

fn get_header_id(&self) -> Self::HeaderId

Computes the identifier of the header.

Source

fn validate_header(&self, header_id: Self::HeaderId) -> bool

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<A: CRDT> ECGHeader for TestHeader<A>

Source§

impl<Hash> ECGHeader for Header<Hash>
where Hash: Serialize + Clone + Copy + Debug + Ord + Hash,