Skip to main content

Metadata

Trait Metadata 

Source
pub trait Metadata:
    DeserializeOwned
    + Serialize
    + Clone
    + Send {
    type Error: Clone + MetadataError;

    // Required methods
    fn timestamp(&self) -> Timestamp;
    fn set_timestamp(&mut self, timestamp: Timestamp);
    fn errors(&self) -> Option<&[Self::Error]>;
    fn set_errors(&mut self, errors: Vec<Self::Error>);

    // Provided methods
    fn has_errors(&self) -> bool { ... }
    fn merge(&mut self, other: Self) { ... }
}

Required Associated Types§

Source

type Error: Clone + MetadataError

The type of error returned in this metadata.

Required Methods§

Source

fn timestamp(&self) -> Timestamp

Returns the timestamp at which this value was recorded.

Source

fn set_timestamp(&mut self, timestamp: Timestamp)

Overrides the timestamp at which this value was recorded.

Source

fn errors(&self) -> Option<&[Self::Error]>

Returns the errors recorded with this value, if any.

Source

fn set_errors(&mut self, errors: Vec<Self::Error>)

Overrides the errors associated with this value.

Provided Methods§

Source

fn has_errors(&self) -> bool

Returns whether any errors are recorded on this value.

Source

fn merge(&mut self, other: Self)

Merge with another Metadata, taking latest timestamps and combining errors.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§