pub struct Extensions(/* private fields */);Expand description
Extensions are available as part of Activity Definitions, as part
of a Statement’s context or result properties. In each case,
they’re intended to provide a natural way to extend those properties for
some specialized use.
The contents of these Extensions might be something valuable to just one application, or it might be a convention used by an entire Community of Practice.
From 4.2.7 Additional Requirements for Data Types / Extension:
- The LRS shall reject any Statement where a key of an extensions map is not an IRI.
- An LRS shall not reject a Statement based on the values of the extensions map.
Implementations§
Source§impl Extensions
impl Extensions
Sourcepub fn get(&self, key: &IriStr) -> Option<&Value>
pub fn get(&self, key: &IriStr) -> Option<&Value>
Return the Value associated w/ the given key if present in this
collection; None otherwise.
Sourcepub fn contains_key(&self, key: &IriStr) -> bool
pub fn contains_key(&self, key: &IriStr) -> bool
Returns TRUE if the collection contains a value for the given key.
Return FALSE otherwise.
Sourcepub fn add(&mut self, key_str: &str, v: &Value) -> Result<(), DataError>
pub fn add(&mut self, key_str: &str, v: &Value) -> Result<(), DataError>
Add a key-value pair to this collection.
Sourcepub fn append(&mut self, other: &mut Extensions)
pub fn append(&mut self, other: &mut Extensions)
Moves all elements from other into self, leaving other empty.
If a key from other is already present in self, the respective
value from self will be overwritten with the respective value from
other.
Trait Implementations§
Source§impl Clone for Extensions
impl Clone for Extensions
Source§fn clone(&self) -> Extensions
fn clone(&self) -> Extensions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Extensions
impl Debug for Extensions
Source§impl Default for Extensions
impl Default for Extensions
Source§fn default() -> Extensions
fn default() -> Extensions
Source§impl<'de> Deserialize<'de> for Extensions
impl<'de> Deserialize<'de> for Extensions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for Extensions
impl Display for Extensions
Source§impl Fingerprint for Extensions
impl Fingerprint for Extensions
Source§impl PartialEq for Extensions
impl PartialEq for Extensions
Source§fn eq(&self, other: &Extensions) -> bool
fn eq(&self, other: &Extensions) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for Extensions
impl Serialize for Extensions
impl StructuralPartialEq for Extensions
Auto Trait Implementations§
impl Freeze for Extensions
impl RefUnwindSafe for Extensions
impl Send for Extensions
impl Sync for Extensions
impl Unpin for Extensions
impl UnsafeUnpin for Extensions
impl UnwindSafe for Extensions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.