Trait mesh_protobuf::encoding::FromNumber

source ·
pub trait FromNumber: Copy {
    // Required methods
    fn from_i64(v: i64) -> Result<Self>;
    fn from_u64(v: u64) -> Result<Self>;
}
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>

Convert from an i64.

source

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

Convert from a u64.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FromNumber for bool

source§

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

source§

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

source§

impl FromNumber for char

source§

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

source§

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

source§

impl FromNumber for i8

source§

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

source§

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

source§

impl FromNumber for i16

source§

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

source§

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

source§

impl FromNumber for i32

source§

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

source§

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

source§

impl FromNumber for i64

source§

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

source§

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

source§

impl FromNumber for isize

source§

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

source§

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

source§

impl FromNumber for u8

source§

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

source§

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

source§

impl FromNumber for u16

source§

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

source§

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

source§

impl FromNumber for u32

source§

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

source§

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

source§

impl FromNumber for u64

source§

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

source§

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

source§

impl FromNumber for usize

source§

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

source§

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

source§

impl FromNumber for NonZeroI8

source§

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

source§

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

source§

impl FromNumber for NonZeroI16

source§

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

source§

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

source§

impl FromNumber for NonZeroI32

source§

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

source§

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

source§

impl FromNumber for NonZeroI64

source§

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

source§

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

source§

impl FromNumber for NonZeroIsize

source§

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

source§

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

source§

impl FromNumber for NonZeroU8

source§

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

source§

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

source§

impl FromNumber for NonZeroU16

source§

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

source§

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

source§

impl FromNumber for NonZeroU32

source§

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

source§

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

source§

impl FromNumber for NonZeroU64

source§

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

source§

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

source§

impl FromNumber for NonZeroUsize

source§

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

source§

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

source§

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

source§

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

source§

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

Implementors§