pub struct MetadataStoreObject<S, C>
where S: Spec, C: MetadataItem,
{ pub spec: S, pub status: <S as Spec>::Status, pub key: <S as Spec>::IndexKey, pub ctx: MetadataContext<C>, }

Fields§

§spec: S§status: <S as Spec>::Status§key: <S as Spec>::IndexKey§ctx: MetadataContext<C>

Implementations§

source§

impl<S, C> MetadataStoreObject<S, C>
where S: Spec, C: MetadataItem, <S as Spec>::Status: Default,

source

pub fn new( key: impl Into<<S as Spec>::IndexKey>, spec: S, status: <S as Spec>::Status ) -> MetadataStoreObject<S, C>

source

pub fn new_with_context( key: impl Into<<S as Spec>::IndexKey>, spec: S, ctx: MetadataContext<C> ) -> MetadataStoreObject<S, C>

source

pub fn with_spec( key: impl Into<<S as Spec>::IndexKey>, spec: S ) -> MetadataStoreObject<S, C>
where C: Default,

source

pub fn with_key( key: impl Into<<S as Spec>::IndexKey> ) -> MetadataStoreObject<S, C>

source

pub fn with_context( self, ctx: impl Into<MetadataContext<C>> ) -> MetadataStoreObject<S, C>

source

pub fn key(&self) -> &<S as Spec>::IndexKey

source

pub fn key_owned(&self) -> <S as Spec>::IndexKey

source

pub fn my_key(self) -> <S as Spec>::IndexKey

source

pub fn spec(&self) -> &S

source

pub fn set_spec(&mut self, spec: S)

source

pub fn status(&self) -> &<S as Spec>::Status

source

pub fn set_status(&mut self, status: <S as Spec>::Status)

source

pub fn ctx(&self) -> &MetadataContext<C>

source

pub fn ctx_mut(&mut self) -> &mut MetadataContext<C>

source

pub fn ctx_owned(&self) -> MetadataContext<C>

source

pub fn set_ctx(&mut self, ctx: MetadataContext<C>)

source

pub fn parts( self ) -> (<S as Spec>::IndexKey, S, <S as Spec>::Status, MetadataContext<C>)

source

pub fn is_owned(&self, uid: &<C as MetadataItem>::UId) -> bool

check if metadata is owned by other

source

pub async fn childrens<T>( &self, child_stores: &LocalStore<T, C> ) -> Vec<MetadataStoreObject<T, C>>
where T: Spec,

find children of this object

source

pub fn is_newer(&self, another: &MetadataStoreObject<S, C>) -> bool

source§

impl<S, C> MetadataStoreObject<S, C>

source

pub fn next_rev(&self) -> MetadataStoreObject<S, C>

Trait Implementations§

source§

impl<S, C> Clone for MetadataStoreObject<S, C>
where S: Clone + Spec, C: Clone + MetadataItem, <S as Spec>::Status: Clone, <S as Spec>::IndexKey: Clone,

source§

fn clone(&self) -> MetadataStoreObject<S, C>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<S, C> Debug for MetadataStoreObject<S, C>
where S: Debug + Spec, C: Debug + MetadataItem, <S as Spec>::Status: Debug, <S as Spec>::IndexKey: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<S, C> DualDiff for MetadataStoreObject<S, C>
where S: Spec, C: MetadataItem + PartialEq,

source§

fn diff(&self, new_value: &MetadataStoreObject<S, C>) -> ChangeFlag

compute difference, in our case we take account of version as well

source§

impl<S, C> PartialEq for MetadataStoreObject<S, C>

source§

fn eq(&self, other: &MetadataStoreObject<S, C>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S, C> StructuralPartialEq for MetadataStoreObject<S, C>
where S: Spec, C: MetadataItem,

Auto Trait Implementations§

§

impl<S, C> Freeze for MetadataStoreObject<S, C>
where S: Freeze, <S as Spec>::Status: Freeze, <S as Spec>::IndexKey: Freeze, C: Freeze,

§

impl<S, C> RefUnwindSafe for MetadataStoreObject<S, C>

§

impl<S, C> Send for MetadataStoreObject<S, C>

§

impl<S, C> Sync for MetadataStoreObject<S, C>

§

impl<S, C> Unpin for MetadataStoreObject<S, C>
where S: Unpin, <S as Spec>::Status: Unpin, <S as Spec>::IndexKey: Unpin, C: Unpin,

§

impl<S, C> UnwindSafe for MetadataStoreObject<S, C>

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more