Enum Value

Source
pub enum Value<'a> {
Show 29 variants Null, True, False, UInt8(u8), Int8(i8), UInt16(u16), Int16(i16), UInt32(u32), Int32(i32), Float(f32), UInt64(u64), Int64(i64), Double(f64), Text(&'a str), DateTime(&'a str), Date(&'a str), Time(&'a str), DecimalStr(&'a str), Blob(&'a [u8]), List(List<'a>), Map(Map<'a>), Object(Object<'a>), Empty(SubType), Byte(SubType, u8), Word(SubType, u16), DWord(SubType, u32), QWord(SubType, u64), UserText(SubType, &'a str), UserBlob(SubType, &'a [u8]),
}
Expand description

Any value in binn format

Variants§

§

Null

Null

§

True

Boolean True

§

False

Boolean False

§

UInt8(u8)

Unsigned 8bit integer (0..255)

§

Int8(i8)

Signed 8bit integer (-128..127)

§

UInt16(u16)

Unsigned 16bit integer (0..65_535)

§

Int16(i16)

Signed 16bit integer (-32_768..32_767)

§

UInt32(u32)

Unsigned 32bit integer (0..4_294_967_295)

§

Int32(i32)

Signed 32bit integer (-2_147_483_648..2_147_483_647)

§

Float(f32)

IEEE 754 single precision floating point number (32bit)

§

UInt64(u64)

Unsigned 64bit integer (0..18_446_744_073_709_551_615)

§

Int64(i64)

Signed 64bit integer (-9_223_372_036_854_775_808..9_223_372_036_854_775_807)

§

Double(f64)

IEEE 754 double precision floating point number (64bit)

§

Text(&'a str)

UTF-8 encoded string

§

DateTime(&'a str)

String representing datetime (exact format not specified)

§

Date(&'a str)

String representing date (exact format not specified)

§

Time(&'a str)

String representing time (exact format not specified)

§

DecimalStr(&'a str)

String representing decimal number (exact format not specified)

§

Blob(&'a [u8])

Binary data

§

List(List<'a>)

Container that stores elements sequentially without keys

§

Map(Map<'a>)

Container that stores key-value pairs with 32bit signed integer as keys

§

Object(Object<'a>)

Container that stores key-value pairs with utf-8 strings as keys (with 255 byte limit for their length)

§

Empty(SubType)

User-defined type with empty storage

§

Byte(SubType, u8)

User-defined type with Byte storage (8bits)

§

Word(SubType, u16)

User-defined type with Word storage (16bits)

§

DWord(SubType, u32)

User-defined type with DWord storage (32bits)

§

QWord(SubType, u64)

User-defined type with QWord storage (64bits)

§

UserText(SubType, &'a str)

User-defined type with Text storage (UTF-8 string)

§

UserBlob(SubType, &'a [u8])

User-defined type with Blob storage (binary data)

Trait Implementations§

Source§

impl<'a> Debug for Value<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> PartialEq for Value<'a>

Source§

fn eq(&self, other: &Value<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> TryFrom<&'a [u8]> for Value<'a>

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &'a [u8]) -> Result<Self, Error>

Performs the conversion.
Source§

impl<'a> TryFrom<Value<'a>> for List<'a>

Source§

type Error = Value<'a>

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<Value<'a>> for Map<'a>

Source§

type Error = Value<'a>

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<Value<'a>> for Object<'a>

Source§

type Error = Value<'a>

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value<'a>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> StructuralPartialEq for Value<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Value<'a>

§

impl<'a> RefUnwindSafe for Value<'a>

§

impl<'a> !Send for Value<'a>

§

impl<'a> !Sync for Value<'a>

§

impl<'a> Unpin for Value<'a>

§

impl<'a> UnwindSafe for Value<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.