Skip to main content

Value

Trait Value 

Source
pub trait Value: Debug {
    type SelfType<'a>: Debug + 'a
       where Self: 'a;
    type AsBytes<'a>: AsRef<[u8]> + 'a
       where Self: 'a;

    const NICHE: Option<&'static [u8]> = None;

    // Required methods
    fn fixed_width() -> Option<usize>;
    fn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>
       where Self: 'a;
    fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Self::AsBytes<'a>
       where Self: 'b;
    fn type_name() -> TypeName;
}
Expand description

Types that implement this trait can be used as values in a redb table

Provided Associated Constants§

Source

const NICHE: Option<&'static [u8]> = None

A byte string that as_bytes() never returns, if the type declares one.

Implementations must ensure that as_bytes() never returns it, for any value. A fixed width type’s niche must be exactly fixed_width() bytes long; a variable width type’s may be any length, including empty. The default, None, declares no niche.

Container types may use it as an encoding that no value of Self occupies: Option<Self>, for example, encodes None as it, in place of a tag byte. Declaring a niche changes the type name of Option<Self>, so it is not equivalent to Option of the type without one.

Required Associated Types§

Source

type SelfType<'a>: Debug + 'a
where Self: 'a,

SelfType<'a> must be the same type as Self with all lifetimes replaced with ’a

Source

type AsBytes<'a>: AsRef<[u8]> + 'a
where Self: 'a,

Required Methods§

Source

fn fixed_width() -> Option<usize>

Width of a fixed type, or None for variable width

Source

fn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>
where Self: 'a,

Deserializes data Implementations may return a view over data, or an owned type

Note: Implementations may assume that data is the return value of as_bytes(&v) for some v of type Self.

Source

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Self::AsBytes<'a>
where Self: 'b,

Serialize the value to a slice

Note: Implementations must ensure that as_bytes() and from_bytes() are inverses. Specifically, for any value v and data returned from as_bytes(&v), as_bytes(from_bytes(data)) must equal data.

Source

fn type_name() -> TypeName

Globally unique identifier for this type

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 Value for &[u8]

Source§

type SelfType<'a> = &'a [u8]
where Self: 'a,

Source§

type AsBytes<'a> = &'a [u8]
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> &'a [u8] ⓘ
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> &'a [u8] ⓘ
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for &str

Source§

const NICHE: Option<&'static [u8]>

Source§

type SelfType<'a> = &'a str
where Self: 'a,

Source§

type AsBytes<'a> = &'a str
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> &'a str
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> &'a str
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for ()

Source§

type SelfType<'a> = ()
where Self: 'a,

Source§

type AsBytes<'a> = &'a [u8]
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(_data: &'a [u8])
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(_: &'a Self::SelfType<'b>) -> &'a [u8] ⓘ
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for NonZeroI8

Source§

const NICHE: Option<&'static [u8]>

Source§

type SelfType<'a> = NonZero<i8>

Source§

type AsBytes<'a> = <i8 as Value>::AsBytes<'a>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> NonZeroI8
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Self::AsBytes<'a>
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for NonZeroI16

Source§

const NICHE: Option<&'static [u8]>

Source§

type SelfType<'a> = NonZero<i16>

Source§

type AsBytes<'a> = <i16 as Value>::AsBytes<'a>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> NonZeroI16
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Self::AsBytes<'a>
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for NonZeroI32

Source§

const NICHE: Option<&'static [u8]>

Source§

type SelfType<'a> = NonZero<i32>

Source§

type AsBytes<'a> = <i32 as Value>::AsBytes<'a>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> NonZeroI32
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Self::AsBytes<'a>
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for NonZeroI64

Source§

const NICHE: Option<&'static [u8]>

Source§

type SelfType<'a> = NonZero<i64>

Source§

type AsBytes<'a> = <i64 as Value>::AsBytes<'a>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> NonZeroI64
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Self::AsBytes<'a>
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for NonZeroI128

Source§

const NICHE: Option<&'static [u8]>

Source§

type SelfType<'a> = NonZero<i128>

Source§

type AsBytes<'a> = <i128 as Value>::AsBytes<'a>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> NonZeroI128
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Self::AsBytes<'a>
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for NonZeroU8

Source§

const NICHE: Option<&'static [u8]>

Source§

type SelfType<'a> = NonZero<u8>

Source§

type AsBytes<'a> = <u8 as Value>::AsBytes<'a>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> NonZeroU8
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Self::AsBytes<'a>
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for NonZeroU16

Source§

const NICHE: Option<&'static [u8]>

Source§

type SelfType<'a> = NonZero<u16>

Source§

type AsBytes<'a> = <u16 as Value>::AsBytes<'a>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> NonZeroU16
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Self::AsBytes<'a>
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for NonZeroU32

Source§

const NICHE: Option<&'static [u8]>

Source§

type SelfType<'a> = NonZero<u32>

Source§

type AsBytes<'a> = <u32 as Value>::AsBytes<'a>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> NonZeroU32
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Self::AsBytes<'a>
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for NonZeroU64

Source§

const NICHE: Option<&'static [u8]>

Source§

type SelfType<'a> = NonZero<u64>

Source§

type AsBytes<'a> = <u64 as Value>::AsBytes<'a>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> NonZeroU64
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Self::AsBytes<'a>
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for NonZeroU128

Source§

const NICHE: Option<&'static [u8]>

Source§

type SelfType<'a> = NonZero<u128>

Source§

type AsBytes<'a> = <u128 as Value>::AsBytes<'a>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> NonZeroU128
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Self::AsBytes<'a>
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for String

Source§

const NICHE: Option<&'static [u8]>

Source§

type SelfType<'a> = String
where Self: 'a,

Source§

type AsBytes<'a> = &'a str
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> String
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> &'a str
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for bool

Source§

const NICHE: Option<&'static [u8]>

Source§

type SelfType<'a> = bool
where Self: 'a,

Source§

type AsBytes<'a> = &'a [u8]
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> bool
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> &'a [u8] ⓘ
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for char

Source§

const NICHE: Option<&'static [u8]>

Source§

type SelfType<'a> = char

Source§

type AsBytes<'a> = [u8; 3]
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> char
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> [u8; 3]
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for f32

Source§

type SelfType<'a> = f32

Source§

type AsBytes<'a> = [u8; 4]
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> f32
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> [u8; 4]
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for f64

Source§

type SelfType<'a> = f64

Source§

type AsBytes<'a> = [u8; 8]
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> f64
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> [u8; 8]
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for i8

Source§

type SelfType<'a> = i8

Source§

type AsBytes<'a> = [u8; 1]
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> i8
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> [u8; 1]
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for i16

Source§

type SelfType<'a> = i16

Source§

type AsBytes<'a> = [u8; 2]
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> i16
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> [u8; 2]
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for i32

Source§

type SelfType<'a> = i32

Source§

type AsBytes<'a> = [u8; 4]
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> i32
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> [u8; 4]
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for i64

Source§

type SelfType<'a> = i64

Source§

type AsBytes<'a> = [u8; 8]
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> i64
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> [u8; 8]
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for i128

Source§

type SelfType<'a> = i128

Source§

type AsBytes<'a> = [u8; 16]
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> i128
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> [u8; 16]
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for u8

Source§

type SelfType<'a> = u8

Source§

type AsBytes<'a> = [u8; 1]
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> u8
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> [u8; 1]
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for u16

Source§

type SelfType<'a> = u16

Source§

type AsBytes<'a> = [u8; 2]
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> u16
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> [u8; 2]
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for u32

Source§

type SelfType<'a> = u32

Source§

type AsBytes<'a> = [u8; 4]
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> u32
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> [u8; 4]
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for u64

Source§

type SelfType<'a> = u64

Source§

type AsBytes<'a> = [u8; 8]
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> u64
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> [u8; 8]
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl Value for u128

Source§

type SelfType<'a> = u128

Source§

type AsBytes<'a> = [u8; 16]
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> u128
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> [u8; 16]
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value, T5: Value, T6: Value, T7: Value, T8: Value, T9: Value, T10: Value, T11: Value> Value for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

Source§

type SelfType<'a> = (<T0 as Value>::SelfType<'a>, <T1 as Value>::SelfType<'a>, <T2 as Value>::SelfType<'a>, <T3 as Value>::SelfType<'a>, <T4 as Value>::SelfType<'a>, <T5 as Value>::SelfType<'a>, <T6 as Value>::SelfType<'a>, <T7 as Value>::SelfType<'a>, <T8 as Value>::SelfType<'a>, <T9 as Value>::SelfType<'a>, <T10 as Value>::SelfType<'a>, <T11 as Value>::SelfType<'a>)
where Self: 'a,

Source§

type AsBytes<'a> = Vec<u8>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Vec<u8> ⓘ
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value, T5: Value, T6: Value, T7: Value, T8: Value, T9: Value, T10: Value> Value for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

Source§

type SelfType<'a> = (<T0 as Value>::SelfType<'a>, <T1 as Value>::SelfType<'a>, <T2 as Value>::SelfType<'a>, <T3 as Value>::SelfType<'a>, <T4 as Value>::SelfType<'a>, <T5 as Value>::SelfType<'a>, <T6 as Value>::SelfType<'a>, <T7 as Value>::SelfType<'a>, <T8 as Value>::SelfType<'a>, <T9 as Value>::SelfType<'a>, <T10 as Value>::SelfType<'a>)
where Self: 'a,

Source§

type AsBytes<'a> = Vec<u8>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Vec<u8> ⓘ
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value, T5: Value, T6: Value, T7: Value, T8: Value, T9: Value> Value for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)

Source§

type SelfType<'a> = (<T0 as Value>::SelfType<'a>, <T1 as Value>::SelfType<'a>, <T2 as Value>::SelfType<'a>, <T3 as Value>::SelfType<'a>, <T4 as Value>::SelfType<'a>, <T5 as Value>::SelfType<'a>, <T6 as Value>::SelfType<'a>, <T7 as Value>::SelfType<'a>, <T8 as Value>::SelfType<'a>, <T9 as Value>::SelfType<'a>)
where Self: 'a,

Source§

type AsBytes<'a> = Vec<u8>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Vec<u8> ⓘ
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value, T5: Value, T6: Value, T7: Value, T8: Value> Value for (T0, T1, T2, T3, T4, T5, T6, T7, T8)

Source§

type SelfType<'a> = (<T0 as Value>::SelfType<'a>, <T1 as Value>::SelfType<'a>, <T2 as Value>::SelfType<'a>, <T3 as Value>::SelfType<'a>, <T4 as Value>::SelfType<'a>, <T5 as Value>::SelfType<'a>, <T6 as Value>::SelfType<'a>, <T7 as Value>::SelfType<'a>, <T8 as Value>::SelfType<'a>)
where Self: 'a,

Source§

type AsBytes<'a> = Vec<u8>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Vec<u8> ⓘ
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value, T5: Value, T6: Value, T7: Value> Value for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

type SelfType<'a> = (<T0 as Value>::SelfType<'a>, <T1 as Value>::SelfType<'a>, <T2 as Value>::SelfType<'a>, <T3 as Value>::SelfType<'a>, <T4 as Value>::SelfType<'a>, <T5 as Value>::SelfType<'a>, <T6 as Value>::SelfType<'a>, <T7 as Value>::SelfType<'a>)
where Self: 'a,

Source§

type AsBytes<'a> = Vec<u8>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Vec<u8> ⓘ
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value, T5: Value, T6: Value> Value for (T0, T1, T2, T3, T4, T5, T6)

Source§

type SelfType<'a> = (<T0 as Value>::SelfType<'a>, <T1 as Value>::SelfType<'a>, <T2 as Value>::SelfType<'a>, <T3 as Value>::SelfType<'a>, <T4 as Value>::SelfType<'a>, <T5 as Value>::SelfType<'a>, <T6 as Value>::SelfType<'a>)
where Self: 'a,

Source§

type AsBytes<'a> = Vec<u8>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Vec<u8> ⓘ
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value, T5: Value> Value for (T0, T1, T2, T3, T4, T5)

Source§

type SelfType<'a> = (<T0 as Value>::SelfType<'a>, <T1 as Value>::SelfType<'a>, <T2 as Value>::SelfType<'a>, <T3 as Value>::SelfType<'a>, <T4 as Value>::SelfType<'a>, <T5 as Value>::SelfType<'a>)
where Self: 'a,

Source§

type AsBytes<'a> = Vec<u8>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Vec<u8> ⓘ
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value, T4: Value> Value for (T0, T1, T2, T3, T4)

Source§

type SelfType<'a> = (<T0 as Value>::SelfType<'a>, <T1 as Value>::SelfType<'a>, <T2 as Value>::SelfType<'a>, <T3 as Value>::SelfType<'a>, <T4 as Value>::SelfType<'a>)
where Self: 'a,

Source§

type AsBytes<'a> = Vec<u8>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Vec<u8> ⓘ
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl<T0: Value, T1: Value, T2: Value, T3: Value> Value for (T0, T1, T2, T3)

Source§

type SelfType<'a> = (<T0 as Value>::SelfType<'a>, <T1 as Value>::SelfType<'a>, <T2 as Value>::SelfType<'a>, <T3 as Value>::SelfType<'a>)
where Self: 'a,

Source§

type AsBytes<'a> = Vec<u8>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Vec<u8> ⓘ
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl<T0: Value, T1: Value, T2: Value> Value for (T0, T1, T2)

Source§

type SelfType<'a> = (<T0 as Value>::SelfType<'a>, <T1 as Value>::SelfType<'a>, <T2 as Value>::SelfType<'a>)
where Self: 'a,

Source§

type AsBytes<'a> = Vec<u8>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Vec<u8> ⓘ
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl<T0: Value, T1: Value> Value for (T0, T1)

Source§

type SelfType<'a> = (<T0 as Value>::SelfType<'a>, <T1 as Value>::SelfType<'a>)
where Self: 'a,

Source§

type AsBytes<'a> = Vec<u8>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Vec<u8> ⓘ
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl<T: Value> Value for (T,)

Source§

const NICHE: Option<&'static [u8]> = T::NICHE

Source§

type SelfType<'a> = (<T as Value>::SelfType<'a>,)
where Self: 'a,

Source§

type AsBytes<'a> = <T as Value>::AsBytes<'a>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> Self::SelfType<'a>
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Self::AsBytes<'a>
where Self: 'a + 'b,

Source§

fn type_name() -> TypeName

Source§

impl<T: Value> Value for Option<T>

Source§

type SelfType<'a> = Option<<T as Value>::SelfType<'a>>
where Self: 'a,

Source§

type AsBytes<'a> = Vec<u8>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> Option<T::SelfType<'a>>
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Vec<u8> ⓘ
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

impl<T: Value> Value for Vec<T>

Source§

type SelfType<'a> = Vec<<T as Value>::SelfType<'a>>
where Self: 'a,

Source§

type AsBytes<'a> = Vec<u8>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> Vec<T::SelfType<'a>>
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Vec<T::SelfType<'b>>) -> Vec<u8> ⓘ
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

impl<const N: usize, T: Value> Value for [T; N]

Source§

type SelfType<'a> = [<T as Value>::SelfType<'a>; N]
where Self: 'a,

Source§

type AsBytes<'a> = Vec<u8>
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> [T::SelfType<'a>; N]
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> Vec<u8> ⓘ
where Self: 'b,

Source§

fn type_name() -> TypeName

Source§

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

Source§

type SelfType<'a> = &'a [u8; N]
where Self: 'a,

Source§

type AsBytes<'a> = &'a [u8; N]
where Self: 'a,

Source§

fn fixed_width() -> Option<usize>

Source§

fn from_bytes<'a>(data: &'a [u8]) -> &'a [u8; N]
where Self: 'a,

Source§

fn as_bytes<'a, 'b: 'a>(value: &'a Self::SelfType<'b>) -> &'a [u8; N]
where Self: 'b,

Source§

fn type_name() -> TypeName

Implementors§

Source§

impl<T: Value> Value for Legacy<T>

Source§

type SelfType<'a> = <T as Value>::SelfType<'a>
where Self: 'a,

Source§

type AsBytes<'a> = <T as Value>::AsBytes<'a>
where Self: 'a,