[][src]Struct codd::expression::Singleton

pub struct Singleton<T>(_)
where
    T: Tuple
;

Represents a single tuple of type T.

Example:

use codd::{Database, expression::Singleton};

let mut db = Database::new();
let hello = Singleton::new("Hello".to_string());

assert_eq!(vec!["Hello".to_string()], db.evaluate(&hello).unwrap().into_tuples());

Implementations

impl<T: Tuple> Singleton<T>[src]

pub fn new(tuple: T) -> Self[src]

Create a new instance of Singleton with tuple as the inner value.

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

Returns a reference to the inner value of the receiver.

pub fn into_tuple(self) -> T[src]

Consumes the receiver and returns its inner value.

Trait Implementations

impl<T: Clone> Clone for Singleton<T> where
    T: Tuple
[src]

impl<T: Debug> Debug for Singleton<T> where
    T: Tuple
[src]

impl<T> Expression<T> for Singleton<T> where
    T: Tuple
[src]

impl<T: Tuple> From<Singleton<T>> for Mono<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Singleton<T> where
    T: RefUnwindSafe

impl<T> Send for Singleton<T> where
    T: Send

impl<T> Sync for Singleton<T> where
    T: Sync

impl<T> Unpin for Singleton<T> where
    T: Unpin

impl<T> UnwindSafe for Singleton<T> where
    T: UnwindSafe

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, E> IntoExpression<T, E> for E where
    E: Expression<T>,
    T: Tuple
[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.