pub trait Encoding: Sized {
    type Repr: AsRef<[u8]> + AsMut<[u8]> + Copy + Clone + Sized;

    // Required methods
    fn from_be_bytes(bytes: Self::Repr) -> Self;
    fn from_le_bytes(bytes: Self::Repr) -> Self;
    fn to_be_bytes(&self) -> Self::Repr;
    fn to_le_bytes(&self) -> Self::Repr;
}
Expand description

Encoding support.

Required Associated Types§

source

type Repr: AsRef<[u8]> + AsMut<[u8]> + Copy + Clone + Sized

Byte array representation.

Required Methods§

source

fn from_be_bytes(bytes: Self::Repr) -> Self

Decode from big endian bytes.

source

fn from_le_bytes(bytes: Self::Repr) -> Self

Decode from little endian bytes.

source

fn to_be_bytes(&self) -> Self::Repr

Encode to big endian bytes.

source

fn to_le_bytes(&self) -> Self::Repr

Encode to little endian bytes.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Encoding for Limb

§

type Repr = [u8; 8]

source§

impl Encoding for U64

§

type Repr = [u8; 8]

source§

impl Encoding for U128

§

type Repr = [u8; 16]

source§

impl Encoding for U192

§

type Repr = [u8; 24]

source§

impl Encoding for U256

§

type Repr = [u8; 32]

source§

impl Encoding for U320

§

type Repr = [u8; 40]

source§

impl Encoding for U384

§

type Repr = [u8; 48]

source§

impl Encoding for U448

§

type Repr = [u8; 56]

source§

impl Encoding for U512

§

type Repr = [u8; 64]

source§

impl Encoding for U576

§

type Repr = [u8; 72]

source§

impl Encoding for U640

§

type Repr = [u8; 80]

source§

impl Encoding for U704

§

type Repr = [u8; 88]

source§

impl Encoding for U768

§

type Repr = [u8; 96]

source§

impl Encoding for U832

§

type Repr = [u8; 104]

source§

impl Encoding for U896

§

type Repr = [u8; 112]

source§

impl Encoding for U960

§

type Repr = [u8; 120]

source§

impl Encoding for U1024

§

type Repr = [u8; 128]

source§

impl Encoding for U1088

Available on crate feature extra-sizes only.
§

type Repr = [u8; 136]

source§

impl Encoding for U1152

Available on crate feature extra-sizes only.
§

type Repr = [u8; 144]

source§

impl Encoding for U1216

Available on crate feature extra-sizes only.
§

type Repr = [u8; 152]

source§

impl Encoding for U1280

§

type Repr = [u8; 160]

source§

impl Encoding for U1344

Available on crate feature extra-sizes only.
§

type Repr = [u8; 168]

source§

impl Encoding for U1408

Available on crate feature extra-sizes only.
§

type Repr = [u8; 176]

source§

impl Encoding for U1472

Available on crate feature extra-sizes only.
§

type Repr = [u8; 184]

source§

impl Encoding for U1536

§

type Repr = [u8; 192]

source§

impl Encoding for U1600

Available on crate feature extra-sizes only.
§

type Repr = [u8; 200]

source§

impl Encoding for U1664

Available on crate feature extra-sizes only.
§

type Repr = [u8; 208]

source§

impl Encoding for U1728

Available on crate feature extra-sizes only.
§

type Repr = [u8; 216]

source§

impl Encoding for U1792

§

type Repr = [u8; 224]

source§

impl Encoding for U1856

Available on crate feature extra-sizes only.
§

type Repr = [u8; 232]

source§

impl Encoding for U1920

Available on crate feature extra-sizes only.
§

type Repr = [u8; 240]

source§

impl Encoding for U1984

Available on crate feature extra-sizes only.
§

type Repr = [u8; 248]

source§

impl Encoding for U2048

§

type Repr = [u8; 256]

source§

impl Encoding for U2112

Available on crate feature extra-sizes only.
§

type Repr = [u8; 264]

source§

impl Encoding for U2176

Available on crate feature extra-sizes only.
§

type Repr = [u8; 272]

source§

impl Encoding for U2240

Available on crate feature extra-sizes only.
§

type Repr = [u8; 280]

source§

impl Encoding for U2304

Available on crate feature extra-sizes only.
§

type Repr = [u8; 288]

source§

impl Encoding for U2368

Available on crate feature extra-sizes only.
§

type Repr = [u8; 296]

source§

impl Encoding for U2432

Available on crate feature extra-sizes only.
§

type Repr = [u8; 304]

source§

impl Encoding for U2496

Available on crate feature extra-sizes only.
§

type Repr = [u8; 312]

source§

impl Encoding for U2560

Available on crate feature extra-sizes only.
§

type Repr = [u8; 320]

source§

impl Encoding for U2624

Available on crate feature extra-sizes only.
§

type Repr = [u8; 328]

source§

impl Encoding for U2688

Available on crate feature extra-sizes only.
§

type Repr = [u8; 336]

source§

impl Encoding for U2752

Available on crate feature extra-sizes only.
§

type Repr = [u8; 344]

source§

impl Encoding for U2816

Available on crate feature extra-sizes only.
§

type Repr = [u8; 352]

source§

impl Encoding for U2880

Available on crate feature extra-sizes only.
§

type Repr = [u8; 360]

source§

impl Encoding for U2944

Available on crate feature extra-sizes only.
§

type Repr = [u8; 368]

source§

impl Encoding for U3008

Available on crate feature extra-sizes only.
§

type Repr = [u8; 376]

source§

impl Encoding for U3072

§

type Repr = [u8; 384]

source§

impl Encoding for U3136

Available on crate feature extra-sizes only.
§

type Repr = [u8; 392]

source§

impl Encoding for U3200

Available on crate feature extra-sizes only.
§

type Repr = [u8; 400]

source§

impl Encoding for U3264

Available on crate feature extra-sizes only.
§

type Repr = [u8; 408]

source§

impl Encoding for U3328

Available on crate feature extra-sizes only.
§

type Repr = [u8; 416]

source§

impl Encoding for U3392

Available on crate feature extra-sizes only.
§

type Repr = [u8; 424]

source§

impl Encoding for U3456

Available on crate feature extra-sizes only.
§

type Repr = [u8; 432]

source§

impl Encoding for U3520

Available on crate feature extra-sizes only.
§

type Repr = [u8; 440]

source§

impl Encoding for U3584

§

type Repr = [u8; 448]

source§

impl Encoding for U3648

Available on crate feature extra-sizes only.
§

type Repr = [u8; 456]

source§

impl Encoding for U3712

Available on crate feature extra-sizes only.
§

type Repr = [u8; 464]

source§

impl Encoding for U3776

Available on crate feature extra-sizes only.
§

type Repr = [u8; 472]

source§

impl Encoding for U3840

Available on crate feature extra-sizes only.
§

type Repr = [u8; 480]

source§

impl Encoding for U3904

Available on crate feature extra-sizes only.
§

type Repr = [u8; 488]

source§

impl Encoding for U3968

Available on crate feature extra-sizes only.
§

type Repr = [u8; 496]

source§

impl Encoding for U4032

Available on crate feature extra-sizes only.
§

type Repr = [u8; 504]

source§

impl Encoding for U4096

§

type Repr = [u8; 512]

source§

impl Encoding for U4160

Available on crate feature extra-sizes only.
§

type Repr = [u8; 520]

source§

impl Encoding for U4224

§

type Repr = [u8; 528]

source§

impl Encoding for U4288

Available on crate feature extra-sizes only.
§

type Repr = [u8; 536]

source§

impl Encoding for U4352

§

type Repr = [u8; 544]

source§

impl Encoding for U4416

Available on crate feature extra-sizes only.
§

type Repr = [u8; 552]

source§

impl Encoding for U4480

Available on crate feature extra-sizes only.
§

type Repr = [u8; 560]

source§

impl Encoding for U4544

Available on crate feature extra-sizes only.
§

type Repr = [u8; 568]

source§

impl Encoding for U4608

Available on crate feature extra-sizes only.
§

type Repr = [u8; 576]

source§

impl Encoding for U4672

Available on crate feature extra-sizes only.
§

type Repr = [u8; 584]

source§

impl Encoding for U4736

Available on crate feature extra-sizes only.
§

type Repr = [u8; 592]

source§

impl Encoding for U4800

Available on crate feature extra-sizes only.
§

type Repr = [u8; 600]

source§

impl Encoding for U4864

Available on crate feature extra-sizes only.
§

type Repr = [u8; 608]

source§

impl Encoding for U4928

Available on crate feature extra-sizes only.
§

type Repr = [u8; 616]

source§

impl Encoding for U4992

Available on crate feature extra-sizes only.
§

type Repr = [u8; 624]

source§

impl Encoding for U5056

Available on crate feature extra-sizes only.
§

type Repr = [u8; 632]

source§

impl Encoding for U5120

Available on crate feature extra-sizes only.
§

type Repr = [u8; 640]

source§

impl Encoding for U5184

Available on crate feature extra-sizes only.
§

type Repr = [u8; 648]

source§

impl Encoding for U5248

Available on crate feature extra-sizes only.
§

type Repr = [u8; 656]

source§

impl Encoding for U5312

Available on crate feature extra-sizes only.
§

type Repr = [u8; 664]

source§

impl Encoding for U5376

Available on crate feature extra-sizes only.
§

type Repr = [u8; 672]

source§

impl Encoding for U5440

Available on crate feature extra-sizes only.
§

type Repr = [u8; 680]

source§

impl Encoding for U5504

Available on crate feature extra-sizes only.
§

type Repr = [u8; 688]

source§

impl Encoding for U5568

Available on crate feature extra-sizes only.
§

type Repr = [u8; 696]

source§

impl Encoding for U5632

Available on crate feature extra-sizes only.
§

type Repr = [u8; 704]

source§

impl Encoding for U5696

Available on crate feature extra-sizes only.
§

type Repr = [u8; 712]

source§

impl Encoding for U5760

Available on crate feature extra-sizes only.
§

type Repr = [u8; 720]

source§

impl Encoding for U5824

Available on crate feature extra-sizes only.
§

type Repr = [u8; 728]

source§

impl Encoding for U5888

Available on crate feature extra-sizes only.
§

type Repr = [u8; 736]

source§

impl Encoding for U5952

Available on crate feature extra-sizes only.
§

type Repr = [u8; 744]

source§

impl Encoding for U6016

Available on crate feature extra-sizes only.
§

type Repr = [u8; 752]

source§

impl Encoding for U6080

Available on crate feature extra-sizes only.
§

type Repr = [u8; 760]

source§

impl Encoding for U6144

§

type Repr = [u8; 768]

source§

impl Encoding for U6208

Available on crate feature extra-sizes only.
§

type Repr = [u8; 776]

source§

impl Encoding for U6272

Available on crate feature extra-sizes only.
§

type Repr = [u8; 784]

source§

impl Encoding for U6336

Available on crate feature extra-sizes only.
§

type Repr = [u8; 792]

source§

impl Encoding for U6400

Available on crate feature extra-sizes only.
§

type Repr = [u8; 800]

source§

impl Encoding for U6464

Available on crate feature extra-sizes only.
§

type Repr = [u8; 808]

source§

impl Encoding for U6528

Available on crate feature extra-sizes only.
§

type Repr = [u8; 816]

source§

impl Encoding for U6592

Available on crate feature extra-sizes only.
§

type Repr = [u8; 824]

source§

impl Encoding for U6656

Available on crate feature extra-sizes only.
§

type Repr = [u8; 832]

source§

impl Encoding for U6720

Available on crate feature extra-sizes only.
§

type Repr = [u8; 840]

source§

impl Encoding for U6784

Available on crate feature extra-sizes only.
§

type Repr = [u8; 848]

source§

impl Encoding for U6848

Available on crate feature extra-sizes only.
§

type Repr = [u8; 856]

source§

impl Encoding for U6912

Available on crate feature extra-sizes only.
§

type Repr = [u8; 864]

source§

impl Encoding for U6976

Available on crate feature extra-sizes only.
§

type Repr = [u8; 872]

source§

impl Encoding for U7040

Available on crate feature extra-sizes only.
§

type Repr = [u8; 880]

source§

impl Encoding for U7104

Available on crate feature extra-sizes only.
§

type Repr = [u8; 888]

source§

impl Encoding for U7168

Available on crate feature extra-sizes only.
§

type Repr = [u8; 896]

source§

impl Encoding for U7232

Available on crate feature extra-sizes only.
§

type Repr = [u8; 904]

source§

impl Encoding for U7296

Available on crate feature extra-sizes only.
§

type Repr = [u8; 912]

source§

impl Encoding for U7360

Available on crate feature extra-sizes only.
§

type Repr = [u8; 920]

source§

impl Encoding for U7424

Available on crate feature extra-sizes only.
§

type Repr = [u8; 928]

source§

impl Encoding for U7488

Available on crate feature extra-sizes only.
§

type Repr = [u8; 936]

source§

impl Encoding for U7552

Available on crate feature extra-sizes only.
§

type Repr = [u8; 944]

source§

impl Encoding for U7616

Available on crate feature extra-sizes only.
§

type Repr = [u8; 952]

source§

impl Encoding for U7680

Available on crate feature extra-sizes only.
§

type Repr = [u8; 960]

source§

impl Encoding for U7744

Available on crate feature extra-sizes only.
§

type Repr = [u8; 968]

source§

impl Encoding for U7808

Available on crate feature extra-sizes only.
§

type Repr = [u8; 976]

source§

impl Encoding for U7872

Available on crate feature extra-sizes only.
§

type Repr = [u8; 984]

source§

impl Encoding for U7936

Available on crate feature extra-sizes only.
§

type Repr = [u8; 992]

source§

impl Encoding for U8000

Available on crate feature extra-sizes only.
§

type Repr = [u8; 1000]

source§

impl Encoding for U8064

Available on crate feature extra-sizes only.
§

type Repr = [u8; 1008]

source§

impl Encoding for U8128

Available on crate feature extra-sizes only.
§

type Repr = [u8; 1016]

source§

impl Encoding for U8192

§

type Repr = [u8; 1024]

source§

impl Encoding for U16384

§

type Repr = [u8; 2048]

source§

impl Encoding for U32768

§

type Repr = [u8; 4096]