Trait rasn::types::IntegerType

source ·
pub trait IntegerType:
    Sized
    + Clone
    + Debug
    + TryFrom<i64>
    + TryFrom<i128>
    + TryInto<i128>
    + Into<Integer>
    + Num
    + CheckedAdd {
    const WIDTH: u32;

    // Required methods
    fn try_from_bytes(input: &[u8], codec: Codec) -> Result<Self, DecodeError>;
    fn try_from_signed_bytes(
        input: &[u8],
        codec: Codec,
    ) -> Result<Self, DecodeError>;
    fn try_from_unsigned_bytes(
        input: &[u8],
        codec: Codec,
    ) -> Result<Self, DecodeError>;
}

Required Associated Constants§

Required Methods§

source

fn try_from_bytes(input: &[u8], codec: Codec) -> Result<Self, DecodeError>

source

fn try_from_signed_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source

fn try_from_unsigned_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl IntegerType for i8

source§

const WIDTH: u32 = 8u32

source§

fn try_from_bytes(input: &[u8], codec: Codec) -> Result<Self, DecodeError>

source§

fn try_from_signed_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

fn try_from_unsigned_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

impl IntegerType for i16

source§

const WIDTH: u32 = 16u32

source§

fn try_from_bytes(input: &[u8], codec: Codec) -> Result<Self, DecodeError>

source§

fn try_from_signed_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

fn try_from_unsigned_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

impl IntegerType for i32

source§

const WIDTH: u32 = 32u32

source§

fn try_from_bytes(input: &[u8], codec: Codec) -> Result<Self, DecodeError>

source§

fn try_from_signed_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

fn try_from_unsigned_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

impl IntegerType for i64

source§

const WIDTH: u32 = 64u32

source§

fn try_from_bytes(input: &[u8], codec: Codec) -> Result<Self, DecodeError>

source§

fn try_from_signed_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

fn try_from_unsigned_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

impl IntegerType for i128

source§

const WIDTH: u32 = 128u32

source§

fn try_from_bytes(input: &[u8], codec: Codec) -> Result<Self, DecodeError>

source§

fn try_from_signed_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

fn try_from_unsigned_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

impl IntegerType for isize

source§

const WIDTH: u32 = 32u32

source§

fn try_from_bytes(input: &[u8], codec: Codec) -> Result<Self, DecodeError>

source§

fn try_from_signed_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

fn try_from_unsigned_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

impl IntegerType for u8

source§

const WIDTH: u32 = 8u32

source§

fn try_from_bytes(input: &[u8], codec: Codec) -> Result<Self, DecodeError>

source§

fn try_from_signed_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

fn try_from_unsigned_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

impl IntegerType for u16

source§

const WIDTH: u32 = 16u32

source§

fn try_from_bytes(input: &[u8], codec: Codec) -> Result<Self, DecodeError>

source§

fn try_from_signed_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

fn try_from_unsigned_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

impl IntegerType for u32

source§

const WIDTH: u32 = 32u32

source§

fn try_from_bytes(input: &[u8], codec: Codec) -> Result<Self, DecodeError>

source§

fn try_from_signed_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

fn try_from_unsigned_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

impl IntegerType for u64

source§

const WIDTH: u32 = 64u32

source§

fn try_from_bytes(input: &[u8], codec: Codec) -> Result<Self, DecodeError>

source§

fn try_from_signed_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

fn try_from_unsigned_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

impl IntegerType for u128

source§

const WIDTH: u32 = 128u32

source§

fn try_from_bytes(input: &[u8], codec: Codec) -> Result<Self, DecodeError>

source§

fn try_from_signed_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

fn try_from_unsigned_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

impl IntegerType for usize

source§

const WIDTH: u32 = 32u32

source§

fn try_from_bytes(input: &[u8], codec: Codec) -> Result<Self, DecodeError>

source§

fn try_from_signed_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

source§

fn try_from_unsigned_bytes( input: &[u8], codec: Codec, ) -> Result<Self, DecodeError>

Implementors§

source§

impl IntegerType for Integer

source§

const WIDTH: u32 = 4_294_967_295u32