Skip to main content

LinkStore

Trait LinkStore 

Source
pub trait LinkStore {
    // Required methods
    fn create_link(&mut self, link: Link) -> ThingdResult<Link>;
    fn delete_link(&mut self, id: &str) -> ThingdResult<bool>;
    fn get_link(&self, id: &str) -> ThingdResult<Option<Link>>;
    fn get_neighbors(
        &self,
        reference: &str,
        direction: LinkDirection,
        options: LinkQueryOptions,
    ) -> ThingdResult<Vec<Link>>;
    fn count_links(&self) -> ThingdResult<u64>;
}
Expand description

Graph link operations.

Required Methods§

Create a new graph link.

§Errors

Returns an error when the link cannot be persisted.

Delete a graph link by id.

§Errors

Returns an error when the link cannot be deleted.

Get a graph link by id.

§Errors

Returns an error when the link cannot be read.

Source

fn get_neighbors( &self, reference: &str, direction: LinkDirection, options: LinkQueryOptions, ) -> ThingdResult<Vec<Link>>

Get neighbors of a reference (outgoing, incoming, or both).

§Errors

Returns an error when neighbors cannot be queried.

Count total links.

§Errors

Returns an error when count fails.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§