Skip to main content

LinksStorageRef

Trait LinksStorageRef 

Source
pub trait LinksStorageRef<T: LinkReference>: LinksStorage<T> {
    // Required methods
    fn get_link_ref(&self, index: T) -> Option<&GenericLink<T>>;
    fn all_link_refs(&self) -> Vec<&GenericLink<T>>;

    // Provided method
    fn query_link_refs(
        &self,
        index: Option<T>,
        source: Option<T>,
        target: Option<T>,
    ) -> Vec<&GenericLink<T>> { ... }
}
Expand description

Extension implemented by stores that keep links resident in memory and can therefore lend out references instead of copies.

Memory-mapped stores deliberately do not implement this: their links are decoded from raw memory on read, so there is no stable &GenericLink<T> to borrow.

Required Methods§

Borrows the link stored at index.

Borrows every link in the store.

Provided Methods§

Borrows every link matching the (optional) index/source/target pattern.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§