Trait QueryableHeader

Source
pub trait QueryableHeader<Types: NodeType>: BlockHeader<Types> {
    type NamespaceIndex: Clone + Debug + Hash + PartialEq + Eq + From<i64> + Into<i64> + Send + Sync;
    type NamespaceId: Clone + Debug + Serialize + DeserializeOwned + Send + Sync + Hash + PartialEq + Eq + Copy + From<i64> + Into<i64>;

    // Required methods
    fn namespace_id(
        &self,
        i: &Self::NamespaceIndex,
    ) -> Option<Self::NamespaceId>;
    fn namespace_size(
        &self,
        i: &Self::NamespaceIndex,
        payload_size: usize,
    ) -> u64;
}

Required Associated Types§

Source

type NamespaceIndex: Clone + Debug + Hash + PartialEq + Eq + From<i64> + Into<i64> + Send + Sync

Index for looking up a namespace.

Source

type NamespaceId: Clone + Debug + Serialize + DeserializeOwned + Send + Sync + Hash + PartialEq + Eq + Copy + From<i64> + Into<i64>

Serialized representation of a namespace.

Required Methods§

Source

fn namespace_id(&self, i: &Self::NamespaceIndex) -> Option<Self::NamespaceId>

Resolve a namespace index to the serialized identifier for that namespace.

Source

fn namespace_size(&self, i: &Self::NamespaceIndex, payload_size: usize) -> u64

Get the size taken up by the given namespace in the payload.

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.

Implementors§