pub trait KeyDeserialize {
    type Output: Sized;

    const KEY_ELEMS: u16;

    // Required method
    fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>;

    // Provided method
    fn from_slice(value: &[u8]) -> StdResult<Self::Output> { ... }
}

Required Associated Types§

Required Associated Constants§

source

const KEY_ELEMS: u16

The number of key elements is used for the deserialization of compound keys. It should be equal to PrimaryKey::key().len()

Required Methods§

source

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

Provided Methods§

source

fn from_slice(value: &[u8]) -> StdResult<Self::Output>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl KeyDeserialize for &str

§

type Output = String

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

impl KeyDeserialize for &String

§

type Output = String

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

impl KeyDeserialize for &Vec<u8>

§

type Output = Vec<u8>

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

impl KeyDeserialize for &Addr

§

type Output = Addr

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

impl KeyDeserialize for &[u8]

§

type Output = Vec<u8>

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

impl KeyDeserialize for i8

§

type Output = i8

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

impl KeyDeserialize for i16

§

type Output = i16

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

impl KeyDeserialize for i32

§

type Output = i32

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

impl KeyDeserialize for i64

§

type Output = i64

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

impl KeyDeserialize for i128

§

type Output = i128

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

impl KeyDeserialize for u8

§

type Output = u8

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

impl KeyDeserialize for u16

§

type Output = u16

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

impl KeyDeserialize for u32

§

type Output = u32

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

impl KeyDeserialize for u64

§

type Output = u64

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

impl KeyDeserialize for u128

§

type Output = u128

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

impl KeyDeserialize for ()

§

type Output = ()

source§

const KEY_ELEMS: u16 = 0u16

source§

fn from_vec(_value: Vec<u8>) -> StdResult<Self::Output>

source§

impl KeyDeserialize for String

§

type Output = String

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

impl KeyDeserialize for Vec<u8>

§

type Output = Vec<u8>

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

impl KeyDeserialize for Addr

§

type Output = Addr

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

impl<T: KeyDeserialize, U: KeyDeserialize> KeyDeserialize for (T, U)

source§

impl<T: KeyDeserialize, U: KeyDeserialize, V: KeyDeserialize> KeyDeserialize for (T, U, V)

source§

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

§

type Output = [u8; N]

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

source§

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

§

type Output = [u8; N]

source§

const KEY_ELEMS: u16 = 1u16

source§

fn from_vec(value: Vec<u8>) -> StdResult<Self::Output>

Implementors§