[][src]Struct elastic_types::boolean::prelude::Boolean

pub struct Boolean<TMapping> where
    TMapping: BooleanMapping
{ /* fields omitted */ }

An Elasticsearch boolean with a mapping.

Where the mapping isn't custom, you can use the standard library bool instead.

Examples

Defining a bool with a mapping:

let boolean = Boolean::<DefaultBooleanMapping>::new(true);

Methods

impl<TMapping> Boolean<TMapping> where
    TMapping: BooleanMapping
[src]

pub fn new<I>(boolean: I) -> Boolean<TMapping> where
    I: Into<bool>, 
[src]

Creates a new Boolean with the given mapping.

Examples

Create a new Boolean from a bool:

let boolean = Boolean::<DefaultBooleanMapping>::new(false);

pub fn remap<TNewMapping>(boolean: Boolean<TMapping>) -> Boolean<TNewMapping> where
    TNewMapping: BooleanMapping
[src]

Change the mapping of this boolean.

Examples

Change the mapping for a given Boolean:

let boolean = Boolean::<DefaultBooleanMapping>::new(true);

let boolean: Boolean<MyBooleanMapping> = Boolean::remap(boolean);

Trait Implementations

impl<TMapping> BooleanFieldType<TMapping> for Boolean<TMapping> where
    TMapping: BooleanMapping
[src]

impl<TMapping: Default> Default for Boolean<TMapping> where
    TMapping: BooleanMapping
[src]

impl<TMapping: PartialEq> PartialEq<Boolean<TMapping>> for Boolean<TMapping> where
    TMapping: BooleanMapping
[src]

impl<M> PartialEq<bool> for Boolean<M> where
    M: BooleanMapping
[src]

impl<M> PartialEq<Boolean<M>> for bool where
    M: BooleanMapping
[src]

impl<M> From<bool> for Boolean<M> where
    M: BooleanMapping
[src]

impl<TMapping: Clone> Clone for Boolean<TMapping> where
    TMapping: BooleanMapping
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<M> Deref for Boolean<M> where
    M: BooleanMapping
[src]

type Target = bool

The resulting type after dereferencing.

impl<TMapping: Debug> Debug for Boolean<TMapping> where
    TMapping: BooleanMapping
[src]

impl<M> Borrow<bool> for Boolean<M> where
    M: BooleanMapping
[src]

impl<TMapping> Serialize for Boolean<TMapping> where
    TMapping: BooleanMapping
[src]

impl<'de, TMapping> Deserialize<'de> for Boolean<TMapping> where
    TMapping: BooleanMapping
[src]

Auto Trait Implementations

impl<TMapping> Send for Boolean<TMapping> where
    TMapping: Send

impl<TMapping> Sync for Boolean<TMapping> where
    TMapping: Sync

Blanket Implementations

impl<T, U> Into 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> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Same for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>,