Struct kdb::Atom[][src]

#[repr(transparent)]pub struct Atom<T> { /* fields omitted */ }

Atoms are the base primitive values in rust-kdb. You can create a new atom by calling KBox::new_atom, or using the From/Into traits on a value.

Examples

use kdb::{KBox, Atom};

let a = KBox::new_atom(42u8); // Creates a KBox<Atom<u8>>
let b: KBox<Atom<u8>> = 27u8.into();
println!("{} dudes!", a.value() + b.value());

Implementations

impl<T: KValue> Atom<T>[src]

pub fn value(&self) -> T[src]

Returns a copy of the value stored in the atom.

pub fn set_value(&mut self, val: T)[src]

Changes the value stored in th atom.

Trait Implementations

impl<T: KValue> AsRef<Any> for Atom<T>[src]

impl<T: KValue + Debug> Debug for Atom<T>[src]

impl<T: KValue + Display> Display for Atom<T>[src]

impl From<Atom<Date>> for Date[src]

impl From<Atom<DateTime>> for DateTime[src]

impl From<Atom<Minute>> for Minute[src]

impl From<Atom<Month>> for Month[src]

impl From<Atom<Second>> for Second[src]

impl From<Atom<Symbol>> for Symbol[src]

impl From<Atom<Time>> for Time[src]

impl From<Atom<Timespan>> for Timespan[src]

impl From<Atom<Timestamp>> for Timestamp[src]

impl<T> TryFrom<&'_ Any> for &Atom<T> where
    T: KValue, 
[src]

type Error = ConversionError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<T> RefUnwindSafe for Atom<T> where
    T: RefUnwindSafe
[src]

impl<T> !Send for Atom<T>[src]

impl<T> !Sync for Atom<T>[src]

impl<T> Unpin for Atom<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for Atom<T> where
    T: UnwindSafe
[src]

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> ToString for T where
    T: Display + ?Sized
[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.