[][src]Enum b3_rs::ItemKey

pub enum ItemKey {
    NoKey,
    IntegerKey(u64),
    StringKey(String),
    BytesKey(Vec<u8>),
}

An item key.

Variants

NoKey

No key is set for this item.

IntegerKey(u64)

The key is a UVarInt (unsigned LEB128).

StringKey(String)

The key is a UTF-8 encoded string.

The key is encoded as the length of the UTF-8 string in bytes as a UVarInt (unsigned LEB128), and then the bytes of the string.

BytesKey(Vec<u8>)

The key is a byte array.

The key is encoded as the length of the byte array as a UVarInt (unsigned LEB128), and then the bytes.

Implementations

impl ItemKey[src]

pub fn type_bits(&self) -> u8[src]

Return the bits that would be set in the item control byte for the key type.

pub fn encode(&self) -> Result<Vec<u8>, Error>[src]

Encode the key into it's byte representation.

pub fn decode(base: u8, ext: &[u8]) -> Result<(Self, usize), Error>[src]

Trait Implementations

impl Clone for ItemKey[src]

impl Debug for ItemKey[src]

impl<'_> From<&'_ [u8]> for ItemKey[src]

impl<'_> From<&'_ str> for ItemKey[src]

impl From<String> for ItemKey[src]

impl From<Vec<u8>> for ItemKey[src]

impl From<u64> for ItemKey[src]

impl PartialEq<ItemKey> for ItemKey[src]

impl StructuralPartialEq for ItemKey[src]

Auto Trait Implementations

impl RefUnwindSafe for ItemKey

impl Send for ItemKey

impl Sync for ItemKey

impl Unpin for ItemKey

impl UnwindSafe for ItemKey

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.