mesh::payload::encoding

Trait FixedNumber

Source
pub trait FixedNumber: Copy {
    type Type;

    // Required methods
    fn to_fixed(self) -> Self::Type;
    fn from_fixed(_: Self::Type) -> Self;
}
Expand description

A FixedNumber can be converted to a u32 or u64 type for use with fixed64 and fixed32 fields.

Required Associated Types§

Source

type Type

The target type, u32 or u64.

Required Methods§

Source

fn to_fixed(self) -> Self::Type

Converts to the fixed type.

Source

fn from_fixed(_: Self::Type) -> Self

Converts from the fixed type.

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 FixedNumber for f32

Source§

impl FixedNumber for f64

Source§

impl FixedNumber for i32

Source§

impl FixedNumber for i64

Source§

impl FixedNumber for u32

Source§

impl FixedNumber for u64

Implementors§