Struct elastic_types::boolean::Boolean []

pub struct Boolean<M> where
    M: 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<M> Boolean<M> where
    M: BooleanMapping

Creates a new Boolean with the given mapping.

Examples

Create a new Boolean from a bool:

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

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<M: Debug> Debug for Boolean<M> where
    M: BooleanMapping

Formats the value using the given formatter.

impl<M: Clone> Clone for Boolean<M> where
    M: BooleanMapping

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<M: Default> Default for Boolean<M> where
    M: BooleanMapping

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

impl<M: PartialEq> PartialEq for Boolean<M> where
    M: BooleanMapping

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

This method tests for !=.

impl<M> BooleanFieldType<M> for Boolean<M> where
    M: BooleanMapping

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

Performs the conversion.

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

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

This method tests for !=.

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

The resulting type after dereferencing

The method called to dereference a value

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

Immutably borrows from an owned value. Read more

impl<M> Serialize for Boolean<M> where
    M: BooleanMapping

Serialize this value into the given Serde serializer. Read more

impl<'de, M> Deserialize<'de> for Boolean<M> where
    M: BooleanMapping

Deserialize this value from the given Serde deserializer. Read more