PrimitiveLike

Trait PrimitiveLike 

Source
pub trait PrimitiveLike: Sized {
    // Required methods
    fn into_primitive(self) -> Primitive;
    fn try_from_primitive(primitive: Primitive) -> Result<Self, Primitive>;
}
Expand description

Represents some data that can be converted to and from a Primitive

Required Methods§

Source

fn into_primitive(self) -> Primitive

Consumes this data, converting it into an abstract Primitive

Source

fn try_from_primitive(primitive: Primitive) -> Result<Self, Primitive>

Attempts to convert an abstract Primitive into this data, returning the owned value back if unable to convert

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.

Implementations on Foreign Types§

Source§

impl PrimitiveLike for bool

Source§

impl PrimitiveLike for char

Source§

impl PrimitiveLike for ()

Implementors§