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§
Sourcefn create_link(&mut self, link: Link) -> ThingdResult<Link>
fn create_link(&mut self, link: Link) -> ThingdResult<Link>
Sourcefn delete_link(&mut self, id: &str) -> ThingdResult<bool>
fn delete_link(&mut self, id: &str) -> ThingdResult<bool>
Sourcefn get_neighbors(
&self,
reference: &str,
direction: LinkDirection,
options: LinkQueryOptions,
) -> ThingdResult<Vec<Link>>
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.
Sourcefn count_links(&self) -> ThingdResult<u64>
fn count_links(&self) -> ThingdResult<u64>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".