Trait type_safe_id::Type
source · pub trait Type: Sized {
// Required methods
fn try_from_type_prefix(tag: &str) -> Result<Self, Cow<'static, str>>;
fn to_type_prefix(&self) -> &str;
}
Expand description
Represents a type that can serialize to and be parsed from a tag
Required Methods§
sourcefn try_from_type_prefix(tag: &str) -> Result<Self, Cow<'static, str>>
fn try_from_type_prefix(tag: &str) -> Result<Self, Cow<'static, str>>
Try convert the prefix into the well known type. If the prefix is incorrect, return the expected prefix.
sourcefn to_type_prefix(&self) -> &str
fn to_type_prefix(&self) -> &str
Get the prefix from this type
Object Safety§
This trait is not object safe.