pub trait Links<T: LinkReference>: Send + Sync {
// Required methods
fn constants(&self) -> &LinksConstants<T>;
fn count_links(&self, query: &[T]) -> T;
fn create_links(
&mut self,
query: &[T],
handler: WriteHandler<'_, T>,
) -> Result<Flow, Error<T>>;
fn each_links(&self, query: &[T], handler: ReadHandler<'_, T>) -> Flow;
fn update_links(
&mut self,
query: &[T],
change: &[T],
handler: WriteHandler<'_, T>,
) -> Result<Flow, Error<T>>;
fn delete_links(
&mut self,
query: &[T],
handler: WriteHandler<'_, T>,
) -> Result<Flow, Error<T>>;
}Expand description
Low-level, raw slice-based interface for a doublets link store.
Implementors are required to be Send + Sync. Most users should prefer the
higher-level Doublets trait which builds on this one.
Required Methods§
Sourcefn constants(&self) -> &LinksConstants<T>
fn constants(&self) -> &LinksConstants<T>
Returns the store’s LinksConstants (any/null/range values).
Sourcefn count_links(&self, query: &[T]) -> T
fn count_links(&self, query: &[T]) -> T
Counts links that match query.
Sourcefn create_links(
&mut self,
query: &[T],
handler: WriteHandler<'_, T>,
) -> Result<Flow, Error<T>>
fn create_links( &mut self, query: &[T], handler: WriteHandler<'_, T>, ) -> Result<Flow, Error<T>>
Creates one or more links matching query and reports each creation via handler.
Sourcefn each_links(&self, query: &[T], handler: ReadHandler<'_, T>) -> Flow
fn each_links(&self, query: &[T], handler: ReadHandler<'_, T>) -> Flow
Iterates over links matching query, calling handler for each.
Sourcefn update_links(
&mut self,
query: &[T],
change: &[T],
handler: WriteHandler<'_, T>,
) -> Result<Flow, Error<T>>
fn update_links( &mut self, query: &[T], change: &[T], handler: WriteHandler<'_, T>, ) -> Result<Flow, Error<T>>
Updates links matching query to the new values in change, reporting via handler.
Sourcefn delete_links(
&mut self,
query: &[T],
handler: WriteHandler<'_, T>,
) -> Result<Flow, Error<T>>
fn delete_links( &mut self, query: &[T], handler: WriteHandler<'_, T>, ) -> Result<Flow, Error<T>>
Deletes links matching query and reports each deletion via handler.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".