Struct stam::AnnotationData
source · pub struct AnnotationData { /* private fields */ }Expand description
AnnotationData holds the actual content of an annotation; a key/value pair. (the
term feature is regularly seen for this in certain annotation paradigms).
Annotation Data is deliberately decoupled from the actual Annotation
instances so multiple annotation instances can point to the same content
without causing any overhead in storage. Moreover, it facilitates indexing and
searching. The annotation data is part of an AnnotationDataSet, which
effectively defines a certain user-defined vocabulary.
Once instantiated, instances of this type are, by design, largely immutable. The key and value can not be changed. Create a new AnnotationData and new Annotation for edits.
Implementations§
source§impl AnnotationData
impl AnnotationData
pub fn key(&self) -> DataKeyHandle
sourcepub fn value(&self) -> &DataValue
pub fn value(&self) -> &DataValue
Get the value of this annotationdata. The value will be a DataValue instance. This will return an immutable reference. Note that there is no mutable variant nor a set_value(), values can deliberately only be set once at instantiation. Make a new AnnotationData if you want to change data.
Trait Implementations§
source§impl Clone for AnnotationData
impl Clone for AnnotationData
source§fn clone(&self) -> AnnotationData
fn clone(&self) -> AnnotationData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl DataSize for AnnotationData
impl DataSize for AnnotationData
source§const IS_DYNAMIC: bool = true
const IS_DYNAMIC: bool = true
true, the type has a heap size that can vary at runtime, depending on the actual value.source§const STATIC_HEAP_SIZE: usize = 8usize
const STATIC_HEAP_SIZE: usize = 8usize
IS_DYNAMIC is false, this is
the total amount of heap memory occupied by the value. Otherwise this is a lower bound.source§fn estimate_heap_size(&self) -> usize
fn estimate_heap_size(&self) -> usize
source§impl Debug for AnnotationData
impl Debug for AnnotationData
source§impl<'bytes, Ctx> Decode<'bytes, Ctx> for AnnotationData
impl<'bytes, Ctx> Decode<'bytes, Ctx> for AnnotationData
source§impl<Ctx> Encode<Ctx> for AnnotationData
impl<Ctx> Encode<Ctx> for AnnotationData
source§impl PartialEq for AnnotationData
impl PartialEq for AnnotationData
source§fn eq(&self, other: &AnnotationData) -> bool
fn eq(&self, other: &AnnotationData) -> bool
self and other values to be equal, and is used
by ==.source§impl<'a> Request<AnnotationData> for AnnotationDataHandle
impl<'a> Request<AnnotationData> for AnnotationDataHandle
source§fn to_handle<'store, S>(
&self,
_store: &'store S
) -> Option<AnnotationDataHandle>where
S: StoreFor<AnnotationData>,
fn to_handle<'store, S>(
&self,
_store: &'store S
) -> Option<AnnotationDataHandle>where
S: StoreFor<AnnotationData>,
source§fn requested_id(&self) -> Option<&str>
fn requested_id(&self) -> Option<&str>
source§fn requested_id_owned(self) -> Option<String>
fn requested_id_owned(self) -> Option<String>
source§fn requested_handle(&self) -> Option<T::HandleType>
fn requested_handle(&self) -> Option<T::HandleType>
source§impl Storable for AnnotationData
impl Storable for AnnotationData
type HandleType = AnnotationDataHandle
type StoreHandleType = AnnotationDataSetHandle
type FullHandleType = (AnnotationDataSetHandle, AnnotationDataHandle)
type StoreType = AnnotationDataSet
source§fn handle(&self) -> Option<AnnotationDataHandle>
fn handle(&self) -> Option<AnnotationDataHandle>
StoreFor<T>, this may return None only in the initial
stage when it is still unbounded to a store, so this is almost always safe to unwrap when used in the public API.source§fn with_handle(self, intid: AnnotationDataHandle) -> Self
fn with_handle(self, intid: AnnotationDataHandle) -> Self
source§fn carries_id() -> bool
fn carries_id() -> bool
fn fullhandle( storehandle: Self::StoreHandleType, handle: Self::HandleType ) -> Self::FullHandleType
source§fn handle_or_err(&self) -> Result<Self::HandleType, StamError>
fn handle_or_err(&self) -> Result<Self::HandleType, StamError>
Self::handle() but returns a StamError::Unbound error if there is no internal id.source§fn temp_id(&self) -> Result<String, StamError>
fn temp_id(&self) -> Result<String, StamError>
source§fn as_resultitem<'store>(
&'store self,
store: &'store Self::StoreType,
rootstore: &'store AnnotationStore
) -> ResultItem<'store, Self>where
Self: Sized,
fn as_resultitem<'store>(
&'store self,
store: &'store Self::StoreType,
rootstore: &'store AnnotationStore
) -> ResultItem<'store, Self>where
Self: Sized,
T as a ResultItem<T>, i.e. a wrapped reference that includes a reference to
both this item as well as the store that owns it. All high-level API functions are implemented
on such Result types. You should not need to invoke this yourself.source§fn generate_id(self, idmap: Option<&mut IdMap<Self::HandleType>>) -> Selfwhere
Self: Sized,
fn generate_id(self, idmap: Option<&mut IdMap<Self::HandleType>>) -> Selfwhere
Self: Sized,
source§impl StoreFor<AnnotationData> for AnnotationDataSet
impl StoreFor<AnnotationData> for AnnotationDataSet
source§fn store(&self) -> &Store<AnnotationData>
fn store(&self) -> &Store<AnnotationData>
source§fn store_mut(&mut self) -> &mut Store<AnnotationData>
fn store_mut(&mut self) -> &mut Store<AnnotationData>
source§fn idmap(&self) -> Option<&IdMap<AnnotationDataHandle>>
fn idmap(&self) -> Option<&IdMap<AnnotationDataHandle>>
source§fn idmap_mut(&mut self) -> Option<&mut IdMap<AnnotationDataHandle>>
fn idmap_mut(&mut self) -> Option<&mut IdMap<AnnotationDataHandle>>
fn store_typeinfo() -> &'static str
source§fn insert(&mut self, item: T) -> Result<T::HandleType, StamError>
fn insert(&mut self, item: T) -> Result<T::HandleType, StamError>
source§fn add(self, item: T) -> Result<Self, StamError>where
Self: Sized,
fn add(self, item: T) -> Result<Self, StamError>where
Self: Sized,
source§unsafe fn get_unchecked(&self, handle: T::HandleType) -> Option<&T>
unsafe fn get_unchecked(&self, handle: T::HandleType) -> Option<&T>
source§fn get(&self, item: impl Request<T>) -> Result<&T, StamError>
fn get(&self, item: impl Request<T>) -> Result<&T, StamError>
AnnotationStore::annotation() instead.source§fn get_mut(&mut self, item: impl Request<T>) -> Result<&mut T, StamError>
fn get_mut(&mut self, item: impl Request<T>) -> Result<&mut T, StamError>
source§fn remove(&mut self, handle: T::HandleType) -> Result<(), StamError>
fn remove(&mut self, handle: T::HandleType) -> Result<(), StamError>
source§fn resolve_id(&self, id: &str) -> Result<T::HandleType, StamError>
fn resolve_id(&self, id: &str) -> Result<T::HandleType, StamError>
source§fn iter(&self) -> StoreIter<'_, T>where
T: Storable<StoreType = Self>,
fn iter(&self) -> StoreIter<'_, T>where
T: Storable<StoreType = Self>,
annotations(), resources() instead.