Trait can_type_rs::Conversion

source ·
pub trait Conversion
where Self: Sized,
{ type Type; // Required methods fn from_bits(bits: Self::Type) -> Self; fn from_hex(hex_str: &str) -> Self; fn try_from_bits(bits: Self::Type) -> Option<Self>; fn try_from_hex(hex_str: &str) -> Option<Self>; fn into_bits(self) -> Self::Type; fn into_hex(self) -> String; }

Required Associated Types§

Required Methods§

source

fn from_bits(bits: Self::Type) -> Self

Convert an integer of type Self::Type into Self

source

fn from_hex(hex_str: &str) -> Self

Convert a hexadecimal string slice into Self

source

fn try_from_bits(bits: Self::Type) -> Option<Self>

Convert an integer of type Self::Type into Self

source

fn try_from_hex(hex_str: &str) -> Option<Self>

Convert a hexadecimal string slice into Self

source

fn into_bits(self) -> Self::Type

Convert self into an integer of type Self::Type

source

fn into_hex(self) -> String

Convert self into a hexadecimal string

Object Safety§

This trait is not object safe.

Implementors§