Struct graphannis_core::annostorage::ondisk::AnnoStorageImpl
source · pub struct AnnoStorageImpl<T>{ /* private fields */ }
Expand description
An on-disk implementation of an annotation storage.
Implementations§
source§impl<T> AnnoStorageImpl<T>
impl<T> AnnoStorageImpl<T>
Trait Implementations§
source§impl<T> AnnotationStorage<T> for AnnoStorageImpl<T>where
T: FixedSizeKeySerializer + Send + Sync + PartialOrd + Clone + Default + Serialize + DeserializeOwned,
(T, Arc<AnnoKey>): Into<Match>,
impl<T> AnnotationStorage<T> for AnnoStorageImpl<T>where
T: FixedSizeKeySerializer + Send + Sync + PartialOrd + Clone + Default + Serialize + DeserializeOwned,
(T, Arc<AnnoKey>): Into<Match>,
source§fn insert(&mut self, item: T, anno: Annotation) -> Result<()>
fn insert(&mut self, item: T, anno: Annotation) -> Result<()>
Insert an annotation
anno
(with annotation key and value) for an item item
.source§fn get_annotations_for_item(&self, item: &T) -> Result<Vec<Annotation>>
fn get_annotations_for_item(&self, item: &T) -> Result<Vec<Annotation>>
Get all annotations for an
item
(node or edge).source§fn remove_annotation_for_item(
&mut self,
item: &T,
key: &AnnoKey
) -> Result<Option<Cow<'_, str>>>
fn remove_annotation_for_item( &mut self, item: &T, key: &AnnoKey ) -> Result<Option<Cow<'_, str>>>
Remove the annotation given by its
key
for a specific item
Returns the value for that annotation, if it existed.source§fn get_qnames(&self, name: &str) -> Result<Vec<AnnoKey>>
fn get_qnames(&self, name: &str) -> Result<Vec<AnnoKey>>
Get all qualified annotation names (including namespace) for a given annotation name
source§fn number_of_annotations(&self) -> Result<usize>
fn number_of_annotations(&self) -> Result<usize>
Return the total number of annotations contained in this
AnnotationStorage
.source§fn is_empty(&self) -> Result<bool>
fn is_empty(&self) -> Result<bool>
Return true if there are no annotations in this
AnnotationStorage
.source§fn get_value_for_item(
&self,
item: &T,
key: &AnnoKey
) -> Result<Option<Cow<'_, str>>>
fn get_value_for_item( &self, item: &T, key: &AnnoKey ) -> Result<Option<Cow<'_, str>>>
Get the annotation for a given
item
and the annotation key
.source§fn has_value_for_item(&self, item: &T, key: &AnnoKey) -> Result<bool>
fn has_value_for_item(&self, item: &T, key: &AnnoKey) -> Result<bool>
Returns
true
if the given item
has an annotation for the given key
.source§fn get_keys_for_iterator<'b>(
&'b self,
ns: Option<&str>,
name: Option<&str>,
it: Box<dyn Iterator<Item = Result<T, Box<dyn Error + Send + Sync>>> + 'b>
) -> Result<Vec<Match>>
fn get_keys_for_iterator<'b>( &'b self, ns: Option<&str>, name: Option<&str>, it: Box<dyn Iterator<Item = Result<T, Box<dyn Error + Send + Sync>>> + 'b> ) -> Result<Vec<Match>>
Get the matching annotation keys for each item in the iterator. Read more
source§fn number_of_annotations_by_name(
&self,
ns: Option<&str>,
name: &str
) -> Result<usize>
fn number_of_annotations_by_name( &self, ns: Option<&str>, name: &str ) -> Result<usize>
Return the number of annotations contained in this
AnnotationStorage
filtered by name
and optional namespace (ns
).source§fn exact_anno_search<'a>(
&'a self,
namespace: Option<&str>,
name: &str,
value: ValueSearch<&str>
) -> Box<dyn Iterator<Item = Result<Match>> + 'a>
fn exact_anno_search<'a>( &'a self, namespace: Option<&str>, name: &str, value: ValueSearch<&str> ) -> Box<dyn Iterator<Item = Result<Match>> + 'a>
Returns an iterator for all items that exactly match the given annotation constraints.
The annotation
name
must be given as argument, the other arguments are optional. Read moresource§fn regex_anno_search<'a>(
&'a self,
namespace: Option<&str>,
name: &str,
pattern: &str,
negated: bool
) -> Box<dyn Iterator<Item = Result<Match>> + 'a>
fn regex_anno_search<'a>( &'a self, namespace: Option<&str>, name: &str, pattern: &str, negated: bool ) -> Box<dyn Iterator<Item = Result<Match>> + 'a>
Returns an iterator for all items where the value matches the regular expression.
The annotation
name
and the pattern
for the value must be given as argument, thenamespace
argument is optional and can be used as additional constraint. Read moresource§fn get_all_keys_for_item(
&self,
item: &T,
ns: Option<&str>,
name: Option<&str>
) -> Result<Vec<Arc<AnnoKey>>>
fn get_all_keys_for_item( &self, item: &T, ns: Option<&str>, name: Option<&str> ) -> Result<Vec<Arc<AnnoKey>>>
Get all the annotation keys of a node, filtered by the optional namespace (
ns
) and name
.source§fn guess_max_count(
&self,
ns: Option<&str>,
name: &str,
lower_val: &str,
upper_val: &str
) -> Result<usize>
fn guess_max_count( &self, ns: Option<&str>, name: &str, lower_val: &str, upper_val: &str ) -> Result<usize>
Estimate the number of results for an annotation exact search for a given an inclusive value range. Read more
source§fn guess_max_count_regex(
&self,
ns: Option<&str>,
name: &str,
pattern: &str
) -> Result<usize>
fn guess_max_count_regex( &self, ns: Option<&str>, name: &str, pattern: &str ) -> Result<usize>
Estimate the number of results for an annotation regular expression search
for a given pattern. Read more
source§fn guess_most_frequent_value(
&self,
ns: Option<&str>,
name: &str
) -> Result<Option<Cow<'_, str>>>
fn guess_most_frequent_value( &self, ns: Option<&str>, name: &str ) -> Result<Option<Cow<'_, str>>>
Estimate the most frequent value for a given annotation
name
with an optional namespace (ns
). Read moresource§fn get_all_values(
&self,
key: &AnnoKey,
most_frequent_first: bool
) -> Result<Vec<Cow<'_, str>>>
fn get_all_values( &self, key: &AnnoKey, most_frequent_first: bool ) -> Result<Vec<Cow<'_, str>>>
Return a list of all existing values for a given annotation
key
.
If the most_frequent_first
parameter is true, the results are sorted by their frequency.source§fn annotation_keys(&self) -> Result<Vec<AnnoKey>>
fn annotation_keys(&self) -> Result<Vec<AnnoKey>>
Get all the annotation keys which are part of this annotation storage
source§fn get_largest_item(&self) -> Result<Option<T>>
fn get_largest_item(&self) -> Result<Option<T>>
Return the item with the largest item which has an annotation value in this annotation storage. Read more
source§fn calculate_statistics(&mut self) -> Result<()>
fn calculate_statistics(&mut self) -> Result<()>
(Re-) calculate the internal statistics needed for estimating annotation values. Read more
source§impl NodeAnnotationStorage for AnnoStorageImpl<NodeID>
impl NodeAnnotationStorage for AnnoStorageImpl<NodeID>
impl EdgeAnnotationStorage for AnnoStorageImpl<Edge>
Auto Trait Implementations§
impl<T> Freeze for AnnoStorageImpl<T>where
T: Freeze,
impl<T> !RefUnwindSafe for AnnoStorageImpl<T>
impl<T> Send for AnnoStorageImpl<T>
impl<T> Sync for AnnoStorageImpl<T>
impl<T> Unpin for AnnoStorageImpl<T>where
T: Unpin,
impl<T> !UnwindSafe for AnnoStorageImpl<T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more