mesh_protobuf::encoding

Trait ToNumber

Source
pub trait ToNumber: Copy {
    // Required methods
    fn to_u64(self) -> u64;
    fn to_i64(self) -> i64;
}
Expand description

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

Required Methods§

Source

fn to_u64(self) -> u64

Convert to a u64.

Source

fn to_i64(self) -> i64

Convert to an i64.

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 ToNumber for bool

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for char

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for i8

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for i16

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for i32

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for i64

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for isize

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for u8

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for u16

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for u32

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for u64

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for usize

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for NonZeroI8

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for NonZeroI16

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for NonZeroI32

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for NonZeroI64

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for NonZeroIsize

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for NonZeroU8

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for NonZeroU16

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for NonZeroU32

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for NonZeroU64

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl ToNumber for NonZeroUsize

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl<T: ToNumber> ToNumber for &T

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Source§

impl<T: ToNumber> ToNumber for Wrapping<T>

Source§

fn to_u64(self) -> u64

Source§

fn to_i64(self) -> i64

Implementors§