Skip to main content

PrefixReadOps

Trait PrefixReadOps 

Source
pub trait PrefixReadOps: StrideBase {
    // Required methods
    fn prefix_bitset(&self) -> &Bitset256;
    fn lookup_index(&self, idx: BaseIndex) -> Option<(BaseIndex, &Self::T)>;
    fn get_prefix_exact(&self, idx: BaseIndex) -> Option<&Self::T>;

    // Provided method
    fn prefix_count(&self) -> usize { ... }
}
Expand description

Read-only operations on prefixes stored in nodes.

Required Methods§

Source

fn prefix_bitset(&self) -> &Bitset256

Get a reference to the prefix bitset.

Source

fn lookup_index(&self, idx: BaseIndex) -> Option<(BaseIndex, &Self::T)>

Lookup the prefix value that covers the given index.

Source

fn get_prefix_exact(&self, idx: BaseIndex) -> Option<&Self::T>

Get a reference to the prefix value that matches the given index exactly.

Provided Methods§

Source

fn prefix_count(&self) -> usize

Get the number of prefixes in this node.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T> PrefixReadOps for &T
where T: PrefixReadOps + ?Sized,

Source§

fn prefix_bitset(&self) -> &Bitset256

Source§

fn lookup_index(&self, idx: BaseIndex) -> Option<(BaseIndex, &Self::T)>

Source§

fn get_prefix_exact(&self, idx: BaseIndex) -> Option<&Self::T>

Source§

impl<T> PrefixReadOps for &mut T
where T: PrefixReadOps + ?Sized,

Source§

fn prefix_bitset(&self) -> &Bitset256

Source§

fn lookup_index(&self, idx: BaseIndex) -> Option<(BaseIndex, &Self::T)>

Source§

fn get_prefix_exact(&self, idx: BaseIndex) -> Option<&Self::T>

Implementors§

Source§

impl<T, C> PrefixReadOps for Node<T, C>
where T: 'static, C: Storage + ?Sized,