Skip to main content

Value

Trait Value 

Source
pub trait Value: 'static {
    type Native;

    const NAME: &'static str;
    const KIND: Kind<Definition>;
    const CARDINALITY: Cardinality = Cardinality::Required;

    // Required methods
    fn postcard_write(value: &Self::Native, bytes: &mut Vec<u8>);
    fn postcard_size(value: &Self::Native) -> usize;
    fn postcard_memory(input: &mut Reader<'_>) -> Result<usize, MessageError>;
    fn postcard_read(
        input: &mut Reader<'_>,
    ) -> Result<Self::Native, MessageError>;
}

Required Associated Constants§

Source

const NAME: &'static str

Source

const KIND: Kind<Definition>

Provided Associated Constants§

Source

const CARDINALITY: Cardinality = Cardinality::Required

Required Associated Types§

Required Methods§

Source

fn postcard_write(value: &Self::Native, bytes: &mut Vec<u8>)

Source

fn postcard_size(value: &Self::Native) -> usize

Source

fn postcard_memory(input: &mut Reader<'_>) -> Result<usize, MessageError>

Source

fn postcard_read(input: &mut Reader<'_>) -> Result<Self::Native, MessageError>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl Value for Bytes

Source§

const NAME: &'static str = "harmos_domain::model::storage::codec::Bytes"

Source§

const KIND: Kind<Definition> = Kind::Bytes

Source§

type Native = Vec<u8>

Source§

impl Value for Digest

Source§

const NAME: &'static str = "harmos_domain::model::storage::files::codec::Digest"

Source§

const KIND: Kind<Definition> = Kind::Bytes

Source§

type Native = [u8; 32]

Source§

impl Value for Flag

Source§

const NAME: &'static str = "harmos_domain::model::storage::codec::Flag"

Source§

const KIND: Kind<Definition> = Kind::Bool

Source§

type Native = bool

Source§

impl Value for Float

Source§

const NAME: &'static str = "harmos_domain::model::storage::codec::Float"

Source§

const KIND: Kind<Definition> = Kind::F64

Source§

type Native = f64

Source§

impl Value for Id

Source§

const NAME: &'static str = "harmos_domain::model::storage::codec::Id"

Source§

const KIND: Kind<Definition> = Kind::String

Source§

type Native = Identifier

Source§

impl Value for Index

Source§

const NAME: &'static str = "harmos_domain::model::storage::codec::Index"

Source§

const KIND: Kind<Definition> = Kind::U64

Source§

type Native = usize

Source§

impl Value for Key

Source§

const NAME: &'static str = "harmos_domain::model::storage::objects::codec::Key"

Source§

const KIND: Kind<Definition> = crate::schema::declaration::Kind::String

Source§

type Native = ObjectKey

Source§

impl Value for LocalPath

Source§

const NAME: &'static str = "harmos_domain::model::storage::files::codec::LocalPath"

Source§

const KIND: Kind<Definition> = Kind::Bytes

Source§

type Native = PathBuf

Source§

impl Value for Percent

Source§

const NAME: &'static str = "harmos_domain::model::storage::codec::Percent"

Source§

const KIND: Kind<Definition> = Kind::U32

Source§

type Native = u8

Source§

impl Value for Signed

Source§

const NAME: &'static str = "harmos_domain::model::storage::codec::Signed"

Source§

const KIND: Kind<Definition> = Kind::I64

Source§

type Native = i64

Source§

impl Value for Text

Source§

const NAME: &'static str = "harmos_domain::model::storage::codec::Text"

Source§

const KIND: Kind<Definition> = Kind::String

Source§

type Native = String

Source§

impl Value for Time

Source§

const NAME: &'static str = "harmos_domain::model::storage::codec::timestamp::Time"

Source§

const KIND: Kind<Definition>

Source§

type Native = SystemTime

Source§

impl Value for Unsigned

Source§

const NAME: &'static str = "harmos_domain::model::storage::codec::Unsigned"

Source§

const KIND: Kind<Definition> = Kind::U64

Source§

type Native = u64

Source§

impl Value for Version

Source§

const NAME: &'static str = "harmos_domain::model::storage::codec::Version"

Source§

const KIND: Kind<Definition> = Kind::U32

Source§

type Native = NonZero<u32>

Source§

impl Value for Wide

Source§

const NAME: &'static str = "harmos_domain::model::storage::codec::Wide"

Source§

const KIND: Kind<Definition>

Source§

type Native = u128

Source§

impl Value for WideNonZero

Source§

const NAME: &'static str = "harmos_domain::model::storage::codec::WideNonZero"

Source§

const KIND: Kind<Definition>

Source§

type Native = NonZero<u128>

Source§

impl Value for WideSigned

Source§

const NAME: &'static str = "harmos_domain::model::storage::codec::WideSigned"

Source§

const KIND: Kind<Definition>

Source§

type Native = i128

Source§

impl<A> Value for Many<A>
where A: Value,

Source§

const NAME: &'static str

Source§

const KIND: Kind<Definition> = Wrap<A>::KIND

Source§

const CARDINALITY: Cardinality = Cardinality::Repeated

Source§

type Native = Vec<<A as Value>::Native>

Source§

impl<A> Value for Wrap<A>
where A: Value,

Source§

const NAME: &'static str

Source§

const KIND: Kind<Definition>

Source§

type Native = <A as Value>::Native

Source§

impl<E> Value for Code<E>
where E: Coded,

Source§

const NAME: &'static str

Source§

const KIND: Kind<Definition> = Kind::U32

Source§

type Native = E

Source§

impl<T> Value for Nested<T>
where T: Native,

Source§

impl<T> Value for Optional<T>
where T: Value,

Source§

const NAME: &'static str

Source§

const KIND: Kind<Definition> = T::KIND

Source§

const CARDINALITY: Cardinality = Cardinality::Optional

Source§

type Native = Option<<T as Value>::Native>

Source§

impl<T> Value for Repeated<T>
where T: Native,

Source§

const NAME: &'static str

Source§

const KIND: Kind<Definition> = Nested<T>::KIND

Source§

const CARDINALITY: Cardinality = Cardinality::Repeated

Source§

type Native = Vec<T>

Source§

impl<T> Value for Shared<T>
where T: Native,

Source§

const NAME: &'static str = Nested<T>::NAME

Source§

const KIND: Kind<Definition> = Nested<T>::KIND

Source§

type Native = Arc<T>