Struct graphannis_core::annostorage::ondisk::AnnoStorageImpl

source ·
pub struct AnnoStorageImpl<T>{ /* private fields */ }
Expand description

An on-disk implementation of an annotation storage.

Implementations§

Trait Implementations§

source§

impl<T> AnnotationStorage<T> for AnnoStorageImpl<T>

source§

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>>

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>>>

Remove the annotation given by its key for a specific item Returns the value for that annotation, if it existed.
source§

fn clear(&mut self) -> Result<()>

Remove all annotations.
source§

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>

Return the total number of annotations contained in this AnnotationStorage.
source§

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>>>

Get the annotation for a given item and the annotation key.
source§

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>>

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>

Return the number of annotations contained in this AnnotationStorage filtered by name and optional namespace (ns).
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
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
source§

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>

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>

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>>>

Estimate the most frequent value for a given annotation name with an optional namespace (ns). Read more
source§

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>>

Get all the annotation keys which are part of this annotation storage
source§

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<()>

(Re-) calculate the internal statistics needed for estimating annotation values. Read more
source§

fn load_annotations_from(&mut self, location: &Path) -> Result<()>

Load the annotation from an external location.
source§

fn save_annotations_to(&self, location: &Path) -> Result<()>

Save the current annotation to a location on the disk, but do not remember this location.
source§

impl NodeAnnotationStorage for AnnoStorageImpl<NodeID>

source§

fn get_node_id_from_name(&self, node_name: &str) -> Result<Option<NodeID>>

Return the internal NodeID for the node that has the given node_name as annis::node_name annotation.
source§

fn has_node_name(&self, node_name: &str) -> Result<bool>

Returns true if there is a node with the given node_name as value for the annis::node_name annotation.
source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V