Struct kdb::Atom [−][src]
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]
T: KValue,
Auto Trait Implementations
impl<T> RefUnwindSafe for Atom<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> !Send for Atom<T>
[src]
impl<T> !Sync for Atom<T>
[src]
impl<T> Unpin for Atom<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for Atom<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,