pub trait NamedType: Sized {
type Stored: Schema;
const NAME: &'static str;
// Required methods
fn to_stored(&self) -> Self::Stored;
fn from_stored(stored: Self::Stored) -> Option<Self>;
}Expand description
A type of a format’s own, stored as NamedType::Stored in every form
(text, binary, frames) and described by NamedType::NAME, so a tool
that knows the name shows its own editor (a colour picker, a calendar)
and one that doesn’t edits the stored data. crate::named_schema!
implements Schema for it.
Required Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn from_stored(stored: Self::Stored) -> Option<Self>
fn from_stored(stored: Self::Stored) -> Option<Self>
The value stored holds, if it’s a valid one.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".