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,
M: BooleanMapping,
fn new<I>(boolean: I) -> Boolean<M> where
I: Into<bool>,
I: Into<bool>,
Creates a new Boolean
with the given mapping.
Examples
Create a new Boolean
from a bool
:
let boolean = Boolean::<DefaultBooleanMapping>::new(false);
fn remap<MInto>(boolean: Boolean<M>) -> Boolean<MInto> where
MInto: BooleanMapping,
MInto: BooleanMapping,
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,
M: BooleanMapping,
impl<M: Clone> Clone for Boolean<M> where
M: BooleanMapping,
M: BooleanMapping,
fn clone(&self) -> Boolean<M>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<M: Default> Default for Boolean<M> where
M: BooleanMapping,
M: BooleanMapping,
impl<M: PartialEq> PartialEq for Boolean<M> where
M: BooleanMapping,
M: BooleanMapping,
fn eq(&self, __arg_0: &Boolean<M>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Boolean<M>) -> bool
This method tests for !=
.
impl<M> BooleanFieldType<M> for Boolean<M> where
M: BooleanMapping,
M: BooleanMapping,
impl<M> From<bool> for Boolean<M> where
M: BooleanMapping,
[src]
M: BooleanMapping,
impl<M> PartialEq<bool> for Boolean<M> where
M: BooleanMapping,
[src]
M: BooleanMapping,
fn eq(&self, other: &bool) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &bool) -> bool
This method tests for !=
.
impl<M> Deref for Boolean<M> where
M: BooleanMapping,
[src]
M: BooleanMapping,
type Target = bool
The resulting type after dereferencing
fn deref(&self) -> &bool
The method called to dereference a value
impl<M> Borrow<bool> for Boolean<M> where
M: BooleanMapping,
[src]
M: BooleanMapping,
impl<M> Serialize for Boolean<M> where
M: BooleanMapping,
M: BooleanMapping,
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de, M> Deserialize<'de> for Boolean<M> where
M: BooleanMapping,
M: BooleanMapping,
fn deserialize<D>(deserializer: D) -> Result<Boolean<M>, D::Error> where
D: Deserializer<'de>,
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more