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§

source

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.

source

fn to_type_prefix(&self) -> &str

Get the prefix from this type

Object Safety§

This trait is not object safe.

Implementors§