pub trait Primitive:
'static
+ Default
+ Send
+ Sync {
type A: Atom;
const DTYPE: DataType;
const IS_ATOMIC: bool;
// Required methods
fn to_value(&self) -> Value;
fn try_from_value(v: &Value) -> CoreResult<Self>
where Self: Sized;
fn to_atoms(&self) -> Vec<Self::A>;
fn try_from_atoms(atoms: &[Self::A]) -> CoreResult<Self>
where Self: Sized;
fn new_codec(codec: &str) -> Option<Box<dyn Codec<P = Self>>>;
// Provided method
fn new_value_codec(codec: &str) -> Option<Box<dyn ValueCodec>>
where Self: Sized { ... }
}
Required Associated Constants§
Required Associated Types§
Required Methods§
fn to_value(&self) -> Value
fn try_from_value(v: &Value) -> CoreResult<Self>where
Self: Sized,
fn to_atoms(&self) -> Vec<Self::A>
fn try_from_atoms(atoms: &[Self::A]) -> CoreResult<Self>where
Self: Sized,
fn new_codec(codec: &str) -> Option<Box<dyn Codec<P = Self>>>
Provided Methods§
fn new_value_codec(codec: &str) -> Option<Box<dyn ValueCodec>>where
Self: Sized,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.