logo
pub enum Value {
    Str(String),
    PreTokStr(PreTokenizedString),
    U64(u64),
    I64(i64),
    F64(f64),
    Date(DateTime),
    Facet(Facet),
    Bytes(Vec<u8>),
    JsonObject(Map<String, Value>),
}
Expand description

Value represents the value of a any field. It is an enum over all over all of the possible field type.

Variants

Str(String)

The str type is used for any text information.

PreTokStr(PreTokenizedString)

Pre-tokenized str type,

U64(u64)

Unsigned 64-bits Integer u64

I64(i64)

Signed 64-bits Integer i64

F64(f64)

64-bits Float f64

Date(DateTime)

Date/time with second precision

Facet(Facet)

Facet

Bytes(Vec<u8>)

Arbitrarily sized byte array

JsonObject(Map<String, Value>)

Json object value.

Implementations

Returns the text value, provided the value is of the Str type. (Returns None if the value is not of the Str type).

Returns the facet value, provided the value is of the Facet type. (Returns None if the value is not of the Facet type).

Returns the tokenized text, provided the value is of the PreTokStr type. (Returns None if the value is not of the PreTokStr type.)

Returns the u64-value, provided the value is of the U64 type. (Returns None if the value is not of the U64 type)

Returns the i64-value, provided the value is of the I64 type.

Return None if the value is not of type I64.

Returns the f64-value, provided the value is of the F64 type.

Return None if the value is not of type F64.

Returns the Date-value, provided the value is of the Date type.

Returns None if the value is not of type Date.

Returns the Bytes-value, provided the value is of the Bytes type.

Returns None if the value is not of type Bytes.

Returns the json object, provided the value is of the JsonObject type.

Returns None if the value is not of type JsonObject.

Trait Implementations

Serialize

Deserialize

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

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

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.