Trait mesh::payload::encoding::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.

Object Safety§

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§