Trait mesh_protobuf::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§

type Type = u32

source§

fn to_fixed(self) -> u32

source§

fn from_fixed(v: u32) -> Self

source§

impl FixedNumber for f64

source§

type Type = u64

source§

fn to_fixed(self) -> u64

source§

fn from_fixed(v: u64) -> Self

source§

impl FixedNumber for i32

source§

type Type = u32

source§

fn to_fixed(self) -> u32

source§

fn from_fixed(v: u32) -> Self

source§

impl FixedNumber for i64

source§

type Type = u64

source§

fn to_fixed(self) -> u64

source§

fn from_fixed(v: u64) -> Self

source§

impl FixedNumber for u32

source§

type Type = u32

source§

fn to_fixed(self) -> u32

source§

fn from_fixed(v: u32) -> Self

source§

impl FixedNumber for u64

source§

type Type = u64

source§

fn to_fixed(self) -> u64

source§

fn from_fixed(v: u64) -> Self

Implementors§