Trait mesh::payload::encoding::FromNumber

source ·
pub trait FromNumber: Copy {
    // Required methods
    fn from_i64(v: i64) -> Result<Self, Error>;
    fn from_u64(v: u64) -> Result<Self, Error>;
}
Expand description

A trait for converting a value to from u64 for use in varint encodings.

N.B. The protobuf behavior is to truncate integers rather than fail on overflow.

Required Methods§

source

fn from_i64(v: i64) -> Result<Self, Error>

Convert from an i64.

source

fn from_u64(v: u64) -> Result<Self, Error>

Convert from a u64.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FromNumber for bool

source§

impl FromNumber for char

source§

impl FromNumber for i8

source§

impl FromNumber for i16

source§

impl FromNumber for i32

source§

impl FromNumber for i64

source§

impl FromNumber for isize

source§

impl FromNumber for u8

source§

impl FromNumber for u16

source§

impl FromNumber for u32

source§

impl FromNumber for u64

source§

impl FromNumber for usize

source§

impl FromNumber for NonZero<i8>

source§

impl FromNumber for NonZero<i16>

source§

impl FromNumber for NonZero<i32>

source§

impl FromNumber for NonZero<i64>

source§

impl FromNumber for NonZero<isize>

source§

impl FromNumber for NonZero<u8>

source§

impl FromNumber for NonZero<u16>

source§

impl FromNumber for NonZero<u32>

source§

impl FromNumber for NonZero<u64>

source§

impl FromNumber for NonZero<usize>

source§

impl<T> FromNumber for Wrapping<T>
where T: FromNumber,

Implementors§