Skip to main content

MetadataBuilder

Struct MetadataBuilder 

Source
pub struct MetadataBuilder<N, K, L, W, WV, A, AV, S: State = Empty>
where N: Field, K: Field, L: Field, W: Field, WV: WeightValue, A: Field, AV: AnnotationValue,
{ /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<N, K, L, W, WV, A, AV, S: State> MetadataBuilder<N, K, L, W, WV, A, AV, S>
where N: Field, K: Field, L: Field, W: Field, WV: WeightValue, A: Field, AV: AnnotationValue,

Source

pub fn build(self) -> Metadata<N, K, L, W, WV, A, AV>
where S: IsComplete,

Finish building and return the requested object

Source

pub fn id(self, value: Uuid) -> MetadataBuilder<N, K, L, W, WV, A, AV, SetId<S>>
where S::Id: IsUnset,

Optional (Some / Option setters). Default: Uuid::new_v4().

Instance identifier. Defaults to a randomly generated UUIDv4.

Source

pub fn maybe_id( self, value: Option<Uuid>, ) -> MetadataBuilder<N, K, L, W, WV, A, AV, SetId<S>>
where S::Id: IsUnset,

Optional (Some / Option setters). Default: Uuid::new_v4().

Instance identifier. Defaults to a randomly generated UUIDv4.

Source

pub fn name( self, value: impl Into<N>, ) -> MetadataBuilder<N, K, L, W, WV, A, AV, SetName<S>>
where S::Name: IsUnset,

Optional (Some / Option setters). Name associated with this instance.

Source

pub fn maybe_name( self, value: Option<impl Into<N>>, ) -> MetadataBuilder<N, K, L, W, WV, A, AV, SetName<S>>
where S::Name: IsUnset,

Optional (Some / Option setters). Name associated with this instance.

Source

pub fn kind( self, value: impl Into<K>, ) -> MetadataBuilder<N, K, L, W, WV, A, AV, SetKind<S>>
where S::Kind: IsUnset,

Optional (Some / Option setters). Kind of object or main category associated with this instance.

Source

pub fn maybe_kind( self, value: Option<impl Into<K>>, ) -> MetadataBuilder<N, K, L, W, WV, A, AV, SetKind<S>>
where S::Kind: IsUnset,

Optional (Some / Option setters). Kind of object or main category associated with this instance.

Source

pub fn labels( self, value: BTreeSet<L>, ) -> MetadataBuilder<N, K, L, W, WV, A, AV, SetLabels<S>>
where S::Labels: IsUnset,

Optional (Some / Option setters). Default: BTreeSet::new().

Set of labels associated with this instance.

Source

pub fn maybe_labels( self, value: Option<BTreeSet<L>>, ) -> MetadataBuilder<N, K, L, W, WV, A, AV, SetLabels<S>>
where S::Labels: IsUnset,

Optional (Some / Option setters). Default: BTreeSet::new().

Set of labels associated with this instance.

Source

pub fn weights( self, value: BTreeMap<W, WV>, ) -> MetadataBuilder<N, K, L, W, WV, A, AV, SetWeights<S>>
where S::Weights: IsUnset,

Optional (Some / Option setters). Default: BTreeMap::new().

Numerical weights associated with this instance.

Source

pub fn maybe_weights( self, value: Option<BTreeMap<W, WV>>, ) -> MetadataBuilder<N, K, L, W, WV, A, AV, SetWeights<S>>
where S::Weights: IsUnset,

Optional (Some / Option setters). Default: BTreeMap::new().

Numerical weights associated with this instance.

Source

pub fn annotations( self, value: BTreeMap<A, AV>, ) -> MetadataBuilder<N, K, L, W, WV, A, AV, SetAnnotations<S>>
where S::Annotations: IsUnset,

Optional (Some / Option setters). Default: BTreeMap::new().

Free-form annotations associated with this instance.

Source

pub fn maybe_annotations( self, value: Option<BTreeMap<A, AV>>, ) -> MetadataBuilder<N, K, L, W, WV, A, AV, SetAnnotations<S>>
where S::Annotations: IsUnset,

Optional (Some / Option setters). Default: BTreeMap::new().

Free-form annotations associated with this instance.

Auto Trait Implementations§

§

impl<N, K, L, W, WV, A, AV, S> Freeze for MetadataBuilder<N, K, L, W, WV, A, AV, S>
where N: Freeze, K: Freeze,

§

impl<N, K, L, W, WV, A, AV, S> RefUnwindSafe for MetadataBuilder<N, K, L, W, WV, A, AV, S>

§

impl<N, K, L, W, WV, A, AV, S> Send for MetadataBuilder<N, K, L, W, WV, A, AV, S>
where N: Send, K: Send, W: Send, WV: Send, A: Send, AV: Send, L: Send,

§

impl<N, K, L, W, WV, A, AV, S> Sync for MetadataBuilder<N, K, L, W, WV, A, AV, S>
where N: Sync, K: Sync, W: Sync, WV: Sync, A: Sync, AV: Sync, L: Sync,

§

impl<N, K, L, W, WV, A, AV, S> Unpin for MetadataBuilder<N, K, L, W, WV, A, AV, S>
where N: Unpin, K: Unpin,

§

impl<N, K, L, W, WV, A, AV, S> UnsafeUnpin for MetadataBuilder<N, K, L, W, WV, A, AV, S>
where N: UnsafeUnpin, K: UnsafeUnpin,

§

impl<N, K, L, W, WV, A, AV, S> UnwindSafe for MetadataBuilder<N, K, L, W, WV, A, AV, S>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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.