pub struct ConfigRecord<T> {
pub spec: T,
pub meta: RecordMeta,
}Expand description
Wrapper carrying a spec plus provenance + lifecycle metadata.
Fields§
§spec: T§meta: RecordMetaImplementations§
Source§impl<T> ConfigRecord<T>where
T: DeserializeOwned,
impl<T> ConfigRecord<T>where
T: DeserializeOwned,
Sourcepub fn from_value(value: Value) -> Result<ConfigRecord<T>, Error>
pub fn from_value(value: Value) -> Result<ConfigRecord<T>, Error>
Decode a JSON value, accepting either the new envelope shape OR a
legacy bare-spec shape (in which case the record is synthesized as
RecordSource::User, hidden = false, timestamps = 0).
Detection rule: a value is the envelope if it is an object containing
both "spec" and "meta" keys.
Trait Implementations§
Source§impl<T> Clone for ConfigRecord<T>where
T: Clone,
impl<T> Clone for ConfigRecord<T>where
T: Clone,
Source§fn clone(&self) -> ConfigRecord<T>
fn clone(&self) -> ConfigRecord<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Debug for ConfigRecord<T>where
T: Debug,
impl<T> Debug for ConfigRecord<T>where
T: Debug,
Source§impl<'de, T> Deserialize<'de> for ConfigRecord<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for ConfigRecord<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ConfigRecord<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ConfigRecord<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> PartialEq for ConfigRecord<T>where
T: PartialEq,
impl<T> PartialEq for ConfigRecord<T>where
T: PartialEq,
Source§fn eq(&self, other: &ConfigRecord<T>) -> bool
fn eq(&self, other: &ConfigRecord<T>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<T> Serialize for ConfigRecord<T>where
T: Serialize,
impl<T> Serialize for ConfigRecord<T>where
T: Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<T> Eq for ConfigRecord<T>where
T: Eq,
impl<T> StructuralPartialEq for ConfigRecord<T>
Auto Trait Implementations§
impl<T> Freeze for ConfigRecord<T>where
T: Freeze,
impl<T> RefUnwindSafe for ConfigRecord<T>where
T: RefUnwindSafe,
impl<T> Send for ConfigRecord<T>where
T: Send,
impl<T> Sync for ConfigRecord<T>where
T: Sync,
impl<T> Unpin for ConfigRecord<T>where
T: Unpin,
impl<T> UnsafeUnpin for ConfigRecord<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ConfigRecord<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.