Skip to main content

IntervalTreeSource

Trait IntervalTreeSource 

Source
pub trait IntervalTreeSource {
    type Error;

    // Required methods
    fn cached_interval_tree(
        &self,
    ) -> Option<&Arc<IntervalTree<i64, NodeIntervalBlock>>>;
    fn set_cached_interval_tree(
        &mut self,
        interval_tree: Option<Arc<IntervalTree<i64, NodeIntervalBlock>>>,
    );
    fn load_interval_tree(
        &self,
        conn: &GraphConnection,
    ) -> Result<Arc<IntervalTree<i64, NodeIntervalBlock>>, Self::Error>;

    // Provided method
    fn intervaltree(
        &self,
        conn: &GraphConnection,
    ) -> Result<Arc<IntervalTree<i64, NodeIntervalBlock>>, Self::Error> { ... }
}
Expand description

Provides runtime interval-tree caching and model-specific database loading.

Required Associated Types§

Source

type Error

The error returned while loading or building the interval tree.

Required Methods§

Source

fn cached_interval_tree( &self, ) -> Option<&Arc<IntervalTree<i64, NodeIntervalBlock>>>

Returns the model’s attached runtime tree, if present.

Source

fn set_cached_interval_tree( &mut self, interval_tree: Option<Arc<IntervalTree<i64, NodeIntervalBlock>>>, )

Replaces the model’s attached runtime tree.

Source

fn load_interval_tree( &self, conn: &GraphConnection, ) -> Result<Arc<IntervalTree<i64, NodeIntervalBlock>>, Self::Error>

Loads the tree from the connected graph database without consulting the runtime cache.

Provided Methods§

Source

fn intervaltree( &self, conn: &GraphConnection, ) -> Result<Arc<IntervalTree<i64, NodeIntervalBlock>>, Self::Error>

Returns the attached tree or loads it from the connected graph database.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§