Skip to main content

GraphIndexPrefixAdapter

Struct GraphIndexPrefixAdapter 

Source
pub struct GraphIndexPrefixAdapter<I: IndexLike> { /* private fields */ }
Expand description

An adapter that prefixes/un-prefixes every key passed through to a wrapped index. Mirrors GraphIndexPrefixAdapter.

Implementations§

Source§

impl<I: IndexLike> GraphIndexPrefixAdapter<I>

Source

pub fn new(inner: I, prefix: IndexKey, missing_key_length: usize) -> Self

Trait Implementations§

Source§

impl<I: IndexLike> IndexLike for GraphIndexPrefixAdapter<I>

Source§

fn key_count(&self) -> Result<usize, IndexError>

Number of present keys in the index.
Source§

fn node_ref_lists(&self) -> Result<usize, IndexError>

Number of parallel reference lists per node.
Source§

fn iter_all(&self) -> Result<Vec<IndexEntry>, IndexError>

Iterate every present entry.
Source§

fn iter(&self, keys: &[IndexKey]) -> Result<Vec<IndexEntry>, IndexError>

Iterate present entries restricted to keys.
Source§

fn iter_prefix( &self, prefixes: &[KeyPrefix], ) -> Result<Vec<IndexEntry>, IndexError>

Iterate present entries whose keys match one of prefixes.
Source§

fn external_refs( &self, _ref_list_num: usize, ) -> Result<HashSet<IndexKey>, IndexError>

Set of reference keys at ref_list_num not present in the index.
Source§

fn validate(&self) -> Result<(), IndexError>

Best-effort validation walk.
Source§

fn clear_cache(&self)

Optional cache-clear hook. Default no-op.
Source§

fn find_ancestors( &self, search_keys: &[IndexKey], ref_list_num: usize, parent_map: &mut HashMap<IndexKey, Vec<IndexKey>>, missing_keys: &mut HashSet<IndexKey>, ) -> Result<HashSet<IndexKey>, IndexError>

One step of the ancestry walk used by CombinedGraphIndex::find_ancestry. Looks up each key in the index, populating parent_map[key] = parent_keys for each found entry and adding the unfound keys to missing_keys. Returns the parent keys that aren’t already in parent_map, ready to feed into the next iteration.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Ungil for T
where T: Send,