Skip to main content

Type

Trait 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

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§