Skip to main content

MetadataRefBuilder

Struct MetadataRefBuilder 

Source
pub struct MetadataRefBuilder<'a, 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<'a, N, K, L, W, WV, A, AV, S: State> MetadataRefBuilder<'a, 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) -> MetadataRef<'a, N, K, L, W, WV, A, AV>
where S: IsComplete,

Finish building and return the requested object

Source

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

Required.

Instance identifier. Defaults to a randomly generated UUIDv4.

Source

pub fn name( self, value: &'a N, ) -> MetadataRefBuilder<'a, 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<&'a N>, ) -> MetadataRefBuilder<'a, 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: &'a K, ) -> MetadataRefBuilder<'a, 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<&'a K>, ) -> MetadataRefBuilder<'a, 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<&'a L>, ) -> MetadataRefBuilder<'a, 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<&'a L>>, ) -> MetadataRefBuilder<'a, 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<&'a W, &'a WV>, ) -> MetadataRefBuilder<'a, 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<&'a W, &'a WV>>, ) -> MetadataRefBuilder<'a, 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 A, &'a AV>, ) -> MetadataRefBuilder<'a, 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 A, &'a AV>>, ) -> MetadataRefBuilder<'a, 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<'a, N, K, L, W, WV, A, AV, S> Freeze for MetadataRefBuilder<'a, N, K, L, W, WV, A, AV, S>

§

impl<'a, N, K, L, W, WV, A, AV, S> RefUnwindSafe for MetadataRefBuilder<'a, N, K, L, W, WV, A, AV, S>

§

impl<'a, N, K, L, W, WV, A, AV, S> Send for MetadataRefBuilder<'a, N, K, L, W, WV, A, AV, S>
where N: Sync, K: Sync, W: Sync, WV: Sync, A: Sync, AV: Sync, L: Sync,

§

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

§

impl<'a, N, K, L, W, WV, A, AV, S> Unpin for MetadataRefBuilder<'a, N, K, L, W, WV, A, AV, S>

§

impl<'a, N, K, L, W, WV, A, AV, S> UnsafeUnpin for MetadataRefBuilder<'a, N, K, L, W, WV, A, AV, S>

§

impl<'a, N, K, L, W, WV, A, AV, S> UnwindSafe for MetadataRefBuilder<'a, 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.