Skip to main content

ExternalLensValue

Trait ExternalLensValue 

Source
pub trait ExternalLensValue: Sized {
    const SIZE: usize;

    // Required method
    fn read(bytes: &[u8]) -> Self;
}
Expand description

Copyable value that can be read from a checked external-account byte lens.

Required Associated Constants§

Source

const SIZE: usize

Number of bytes consumed by this lens value.

Required Methods§

Source

fn read(bytes: &[u8]) -> Self

Read a value from exactly Self::SIZE bytes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ExternalLensValue for i8

Source§

const SIZE: usize = 1

Source§

fn read(bytes: &[u8]) -> Self

Source§

impl ExternalLensValue for i16

Source§

const SIZE: usize = 2

Source§

fn read(bytes: &[u8]) -> Self

Source§

impl ExternalLensValue for i32

Source§

const SIZE: usize = 4

Source§

fn read(bytes: &[u8]) -> Self

Source§

impl ExternalLensValue for i64

Source§

const SIZE: usize = 8

Source§

fn read(bytes: &[u8]) -> Self

Source§

impl ExternalLensValue for i128

Source§

const SIZE: usize = 16

Source§

fn read(bytes: &[u8]) -> Self

Source§

impl ExternalLensValue for u8

Source§

const SIZE: usize = 1

Source§

fn read(bytes: &[u8]) -> Self

Source§

impl ExternalLensValue for u16

Source§

const SIZE: usize = 2

Source§

fn read(bytes: &[u8]) -> Self

Source§

impl ExternalLensValue for u32

Source§

const SIZE: usize = 4

Source§

fn read(bytes: &[u8]) -> Self

Source§

impl ExternalLensValue for u64

Source§

const SIZE: usize = 8

Source§

fn read(bytes: &[u8]) -> Self

Source§

impl ExternalLensValue for u128

Source§

const SIZE: usize = 16

Source§

fn read(bytes: &[u8]) -> Self

Source§

impl<const N: usize> ExternalLensValue for [u8; N]

Source§

const SIZE: usize = N

Source§

fn read(bytes: &[u8]) -> Self

Implementors§