Struct kdb::Dictionary[][src]

#[repr(transparent)]pub struct Dictionary { /* fields omitted */ }

A key value based dictionary.

Implementations

impl Dictionary[src]

pub fn len(&self) -> usize[src]

The number of items in the dictionary.

pub fn is_empty(&self) -> bool[src]

Returns true if the dictionary has no items.

pub fn keys(&self) -> &[KBox<Any>][src]

Gets a slice containing all the keys in this dictionary.

pub fn values(&self) -> &[KBox<Any>][src]

Gets a slice containing all the values in this dictionary.

pub fn insert(&mut self, key: impl Into<KBox<Any>>, value: impl Into<KBox<Any>>)[src]

Insert a specified key and value at the end of the dictionary. No checks are done on uniqueness so duplicates are possible.

pub fn get<T: Into<KBox<Any>>>(&self, key: T) -> Option<&KBox<Any>>[src]

Gets a value by key. Note that KDB dictionaries are treated as unordered and hence this is an O(n) operation.

pub fn iter(&self) -> impl Iterator<Item = (&KBox<Any>, &KBox<Any>)>[src]

An iterator through every value in the KDB object

Trait Implementations

impl AsRef<Any> for Dictionary[src]

impl<T> Index<T> for Dictionary where
    T: Into<KBox<Any>>, 
[src]

type Output = Any

The returned type after indexing.

impl TryFrom<&'_ Any> for &Dictionary[src]

type Error = ConversionError

The type returned in the event of a conversion error.

Auto Trait Implementations

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, 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.