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

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]

[src]

Creates a new Boolean with the given mapping.

Examples

Create a new Boolean from a bool:

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

[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: Debug> Debug for Boolean<TMapping> where
    TMapping: BooleanMapping
[src]

[src]

Formats the value using the given formatter. Read more

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

[src]

Returns the "default value" for a type. Read more

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

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

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

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

[src]

Performs the conversion.

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

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

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

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

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

The resulting type after dereferencing.

[src]

Dereferences the value.

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

[src]

Immutably borrows from an owned value. Read more

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

[src]

Serialize this value into the given Serde serializer. Read more

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

[src]

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

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

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