Struct k8_types::store::MetaItem

source ·
pub struct MetaItem<S>where
    S: StoreSpec,{
    pub spec: S,
    pub status: S::Status,
    pub key: S::Key,
    pub ctx: MetaItemContext,
}
Expand description

Metadata object. Used to be KVObject int sc-core

Fields§

§spec: S§status: S::Status§key: S::Key§ctx: MetaItemContext

Implementations§

source§

impl<S> MetaItem<S>where S: StoreSpec,

source

pub fn new<J>(key: J, spec: S, status: S::Status, ctx: MetaItemContext) -> Selfwhere J: Into<S::Key>,

source

pub fn with_ctx(self, ctx: MetaItemContext) -> Self

source

pub fn key(&self) -> &S::Key

source

pub fn key_owned(&self) -> S::Key

source

pub fn my_key(self) -> S::Key

source

pub fn spec(&self) -> &S

source

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

source

pub fn set_status(&mut self, status: S::Status)

source

pub fn ctx(&self) -> &MetaItemContext

source

pub fn set_ctx(&mut self, ctx: MetaItemContext)

source

pub fn parts(self) -> (S::Key, S, MetaItemContext)

source

pub fn is_owned(&self, uid: &str) -> bool

source

pub fn with_spec<J>(key: J, spec: S) -> Selfwhere J: Into<S::Key>,

Trait Implementations§

source§

impl<S> Clone for MetaItem<S>where S: StoreSpec + Clone, S::Status: Clone, S::Key: Clone,

source§

fn clone(&self) -> MetaItem<S>

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> Debug for MetaItem<S>where S: StoreSpec + Debug, S::Status: Debug, S::Key: Debug,

source§

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

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

impl<S> Display for MetaItem<S>where S: StoreSpec, S::Key: Display,

source§

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

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

impl<S> From<MetaItem<S>> for (S::Key, S, S::Status)where S: StoreSpec,

source§

fn from(val: MetaItem<S>) -> Self

Converts to this type from the input type.
source§

impl<S> PartialEq<MetaItem<S>> for MetaItem<S>where S: StoreSpec + PartialEq, S::Status: PartialEq, S::Key: PartialEq,

source§

fn eq(&self, other: &MetaItem<S>) -> 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> Eq for MetaItem<S>where S: StoreSpec + Eq, S::Status: Eq, S::Key: Eq,

source§

impl<S> StructuralEq for MetaItem<S>where S: StoreSpec,

source§

impl<S> StructuralPartialEq for MetaItem<S>where S: StoreSpec,

Auto Trait Implementations§

§

impl<S> RefUnwindSafe for MetaItem<S>where S: RefUnwindSafe, <S as StoreSpec>::Key: RefUnwindSafe, <S as StoreSpec>::Status: RefUnwindSafe,

§

impl<S> Send for MetaItem<S>where S: Send, <S as StoreSpec>::Key: Send, <S as StoreSpec>::Status: Send,

§

impl<S> Sync for MetaItem<S>where S: Sync, <S as StoreSpec>::Key: Sync, <S as StoreSpec>::Status: Sync,

§

impl<S> Unpin for MetaItem<S>where S: Unpin, <S as StoreSpec>::Key: Unpin, <S as StoreSpec>::Status: Unpin,

§

impl<S> UnwindSafe for MetaItem<S>where S: UnwindSafe, <S as StoreSpec>::Key: UnwindSafe, <S as StoreSpec>::Status: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.