pub struct Metadata<N, K, L, W, WV, A, AV>{
pub id: Uuid,
pub name: Option<N>,
pub kind: Option<K>,
pub labels: BTreeSet<L>,
pub weights: BTreeMap<W, WV>,
pub annotations: BTreeMap<A, AV>,
}Expand description
Metadata for any object.
Fields§
§id: UuidInstance identifier. Defaults to a randomly generated UUIDv4.
name: Option<N>Name associated with this instance.
kind: Option<K>Kind of object or main category associated with this instance.
labels: BTreeSet<L>Set of labels associated with this instance.
weights: BTreeMap<W, WV>Numerical weights associated with this instance.
annotations: BTreeMap<A, AV>Free-form annotations associated with this instance.
Implementations§
Source§impl<N, K, L, W, WV, A, AV> Metadata<N, K, L, W, WV, A, AV>
impl<N, K, L, W, WV, A, AV> Metadata<N, K, L, W, WV, A, AV>
Sourcepub fn builder() -> MetadataBuilder<N, K, L, W, WV, A, AV>
pub fn builder() -> MetadataBuilder<N, K, L, W, WV, A, AV>
Create an instance of Metadata using the builder syntax
Source§impl<N, K, L, W, WV, A, AV> Metadata<N, K, L, W, WV, A, AV>
impl<N, K, L, W, WV, A, AV> Metadata<N, K, L, W, WV, A, AV>
Sourcepub fn as_replace_transaction(self) -> Transaction<N, K, L, W, WV, A, AV>
pub fn as_replace_transaction(self) -> Transaction<N, K, L, W, WV, A, AV>
Creates a “replace” transaction from this metadata.
Sourcepub fn as_append_transaction(self) -> Transaction<N, K, L, W, WV, A, AV>
pub fn as_append_transaction(self) -> Transaction<N, K, L, W, WV, A, AV>
Creates an “append” transaction from this metadata.
Trait Implementations§
Source§impl<'de, N, K, L, W, WV, A, AV> Deserialize<'de> for Metadata<N, K, L, W, WV, A, AV>where
N: Field + Deserialize<'de>,
K: Field + Deserialize<'de>,
L: Field + Deserialize<'de>,
W: Field + Deserialize<'de>,
WV: WeightValue + Deserialize<'de>,
A: Field + Deserialize<'de>,
AV: AnnotationValue + Deserialize<'de>,
Metadata<N, K, L, W, WV, A, AV>: Default,
impl<'de, N, K, L, W, WV, A, AV> Deserialize<'de> for Metadata<N, K, L, W, WV, A, AV>where
N: Field + Deserialize<'de>,
K: Field + Deserialize<'de>,
L: Field + Deserialize<'de>,
W: Field + Deserialize<'de>,
WV: WeightValue + Deserialize<'de>,
A: Field + Deserialize<'de>,
AV: AnnotationValue + Deserialize<'de>,
Metadata<N, K, L, W, WV, A, AV>: Default,
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<N, K, L, W, WV, A, AV> PartialEq for Metadata<N, K, L, W, WV, A, AV>
impl<N, K, L, W, WV, A, AV> PartialEq for Metadata<N, K, L, W, WV, A, AV>
Source§impl<'a, N, K, L, W, WV, A, AV> ReadMetadata<'a, N, K, L, W, WV, A, AV> for Metadata<N, K, L, W, WV, A, AV>
impl<'a, N, K, L, W, WV, A, AV> ReadMetadata<'a, N, K, L, W, WV, A, AV> for Metadata<N, K, L, W, WV, A, AV>
impl<N, K, L, W, WV, A, AV> StructuralPartialEq for Metadata<N, K, L, W, WV, A, AV>
Auto Trait Implementations§
impl<N, K, L, W, WV, A, AV> Freeze for Metadata<N, K, L, W, WV, A, AV>
impl<N, K, L, W, WV, A, AV> RefUnwindSafe for Metadata<N, K, L, W, WV, A, AV>where
N: RefUnwindSafe,
K: RefUnwindSafe,
W: RefUnwindSafe,
WV: RefUnwindSafe,
A: RefUnwindSafe,
AV: RefUnwindSafe,
L: RefUnwindSafe,
impl<N, K, L, W, WV, A, AV> Send for Metadata<N, K, L, W, WV, A, AV>
impl<N, K, L, W, WV, A, AV> Sync for Metadata<N, K, L, W, WV, A, AV>
impl<N, K, L, W, WV, A, AV> Unpin for Metadata<N, K, L, W, WV, A, AV>
impl<N, K, L, W, WV, A, AV> UnsafeUnpin for Metadata<N, K, L, W, WV, A, AV>where
N: UnsafeUnpin,
K: UnsafeUnpin,
impl<N, K, L, W, WV, A, AV> UnwindSafe for Metadata<N, K, L, W, WV, A, AV>where
N: UnwindSafe,
K: UnwindSafe,
W: RefUnwindSafe,
WV: RefUnwindSafe,
A: RefUnwindSafe,
AV: RefUnwindSafe,
L: RefUnwindSafe,
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