Struct graphannis_core::annostorage::ondisk::AnnoStorageImpl
source · [−]pub struct AnnoStorageImpl<T> where
T: FixedSizeKeySerializer + Send + Sync + MallocSizeOf + Clone + Serialize + DeserializeOwned, { /* private fields */ }Expand description
An on-disk implementation of an annotation storage.
Implementations
sourceimpl<T> AnnoStorageImpl<T> where
T: FixedSizeKeySerializer + Send + Sync + MallocSizeOf + Clone + Default + Serialize + DeserializeOwned,
(T, Arc<AnnoKey>): Into<Match>,
impl<T> AnnoStorageImpl<T> where
T: FixedSizeKeySerializer + Send + Sync + MallocSizeOf + Clone + Default + Serialize + DeserializeOwned,
(T, Arc<AnnoKey>): Into<Match>,
Trait Implementations
sourceimpl<'de, T> AnnotationStorage<T> for AnnoStorageImpl<T> where
T: FixedSizeKeySerializer + Send + Sync + MallocSizeOf + PartialOrd + Clone + Default + Serialize + DeserializeOwned,
(T, Arc<AnnoKey>): Into<Match>,
impl<'de, T> AnnotationStorage<T> for AnnoStorageImpl<T> where
T: FixedSizeKeySerializer + Send + Sync + MallocSizeOf + PartialOrd + Clone + Default + Serialize + DeserializeOwned,
(T, Arc<AnnoKey>): Into<Match>,
sourcefn 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.
sourcefn 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).
sourcefn 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. Read more
sourcefn 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
sourcefn number_of_annotations(&self) -> Result<usize>
fn number_of_annotations(&self) -> Result<usize>
Return the total number of annotations contained in this AnnotationStorage.
sourcefn is_empty(&self) -> Result<bool>
fn is_empty(&self) -> Result<bool>
Return true if there are no annotations in this AnnotationStorage.
sourcefn 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.
sourcefn 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.
sourcefn 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
sourcefn 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).
sourcefn 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 more
sourcefn 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, the
namespace argument is optional and can be used as additional constraint. Read more
sourcefn 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.
sourcefn 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
sourcefn 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
sourcefn 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 more
sourcefn 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. Read more
sourcefn 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
sourcefn 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
sourcefn calculate_statistics(&mut self) -> Result<()>
fn calculate_statistics(&mut self) -> Result<()>
(Re-) calculate the internal statistics needed for estimating annotation values. Read more
sourcefn load_annotations_from(&mut self, location: &Path) -> Result<()>
fn load_annotations_from(&mut self, location: &Path) -> Result<()>
Load the annotation from an external location.
sourcefn save_annotations_to(&self, location: &Path) -> Result<()>
fn save_annotations_to(&self, location: &Path) -> Result<()>
Save the current annotation to a location on the disk, but do not remember this location.
sourceimpl<T> MallocSizeOf for AnnoStorageImpl<T> where
T: FixedSizeKeySerializer + Send + Sync + MallocSizeOf + Clone + Serialize + DeserializeOwned,
T: MallocSizeOf,
impl<T> MallocSizeOf for AnnoStorageImpl<T> where
T: FixedSizeKeySerializer + Send + Sync + MallocSizeOf + Clone + Serialize + DeserializeOwned,
T: MallocSizeOf,
sourcefn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more