Enum tantivy::schema::document::OwnedValue

source ·
pub enum OwnedValue {
Show 13 variants Null, Str(String), PreTokStr(PreTokenizedString), U64(u64), I64(i64), F64(f64), Bool(bool), Date(DateTime), Facet(Facet), Bytes(Vec<u8>), Array(Vec<Self>), Object(BTreeMap<String, Self>), IpAddr(Ipv6Addr),
}
Expand description

This is a owned variant of Value, that can be passed around without lifetimes. Represents the value of a any field. It is an enum over all over all of the possible field type.

Variants§

§

Null

A null value.

§

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

§

Bool(bool)

Bool value

§

Date(DateTime)

Date/time with nanoseconds precision

§

Facet(Facet)

Facet

§

Bytes(Vec<u8>)

Arbitrarily sized byte array

§

Array(Vec<Self>)

A set of values.

§

Object(BTreeMap<String, Self>)

Dynamic object value.

§

IpAddr(Ipv6Addr)

IpV6 Address. Internally there is no IpV4, it needs to be converted to Ipv6Addr.

Trait Implementations§

source§

impl AsRef<OwnedValue> for OwnedValue

source§

fn as_ref(&self) -> &OwnedValue

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for OwnedValue

source§

fn clone(&self) -> OwnedValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for OwnedValue

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for OwnedValue

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<'a> From<&'a [u8]> for OwnedValue

source§

fn from(bytes: &'a [u8]) -> OwnedValue

Converts to this type from the input type.
source§

impl<'a> From<&'a str> for OwnedValue

source§

fn from(s: &'a str) -> OwnedValue

Converts to this type from the input type.
source§

impl From<BTreeMap<String, OwnedValue>> for OwnedValue

source§

fn from(object: BTreeMap<String, OwnedValue>) -> OwnedValue

Converts to this type from the input type.
source§

impl From<DateTime> for OwnedValue

source§

fn from(dt: DateTime) -> OwnedValue

Converts to this type from the input type.
source§

impl From<Facet> for OwnedValue

source§

fn from(facet: Facet) -> OwnedValue

Converts to this type from the input type.
source§

impl From<FastFieldValue> for OwnedValue

source§

fn from(value: FastFieldValue) -> Self

Converts to this type from the input type.
source§

impl From<FieldValue> for OwnedValue

source§

fn from(field_value: FieldValue) -> Self

Converts to this type from the input type.
source§

impl From<Ipv6Addr> for OwnedValue

source§

fn from(v: Ipv6Addr) -> OwnedValue

Converts to this type from the input type.
source§

impl From<Map<String, Value>> for OwnedValue

source§

fn from(map: Map<String, Value>) -> Self

Converts to this type from the input type.
source§

impl From<PreTokenizedString> for OwnedValue

source§

fn from(pretokenized_string: PreTokenizedString) -> OwnedValue

Converts to this type from the input type.
source§

impl<'a, V: Value<'a>> From<ReferenceValue<'a, V>> for OwnedValue

source§

fn from(val: ReferenceValue<'a, V>) -> OwnedValue

Converts to this type from the input type.
source§

impl From<String> for OwnedValue

source§

fn from(s: String) -> OwnedValue

Converts to this type from the input type.
source§

impl From<Value> for OwnedValue

source§

fn from(value: Value) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u8>> for OwnedValue

source§

fn from(bytes: Vec<u8>) -> OwnedValue

Converts to this type from the input type.
source§

impl From<bool> for OwnedValue

source§

fn from(b: bool) -> Self

Converts to this type from the input type.
source§

impl From<f64> for OwnedValue

source§

fn from(v: f64) -> OwnedValue

Converts to this type from the input type.
source§

impl From<i64> for OwnedValue

source§

fn from(v: i64) -> OwnedValue

Converts to this type from the input type.
source§

impl From<u64> for OwnedValue

source§

fn from(v: u64) -> OwnedValue

Converts to this type from the input type.
source§

impl PartialEq for OwnedValue

source§

fn eq(&self, other: &OwnedValue) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for OwnedValue

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'a> Value<'a> for &'a OwnedValue

§

type ArrayIter = Iter<'a, OwnedValue>

The child value type returned by this doc value. The iterator for walking through the elements within the array.
§

type ObjectIter = ObjectMapIter<'a>

The visitor walking through the key-value pairs within the object.
source§

fn as_value(&self) -> ReferenceValue<'a, Self>

Returns the field value represented by an enum which borrows it’s data.
source§

fn is_null(&self) -> bool

Returns if the value is null or not.
source§

fn as_leaf(&self) -> Option<ReferenceValueLeaf<'a>>

If the Value is a String, returns the associated str. Returns None otherwise.
source§

fn as_str(&self) -> Option<&'a str>

If the Value is a String, returns the associated str. Returns None otherwise.
source§

fn as_u64(&self) -> Option<u64>

If the Value is a u64, returns the associated u64. Returns None otherwise.
source§

fn as_i64(&self) -> Option<i64>

If the Value is a i64, returns the associated i64. Returns None otherwise.
source§

fn as_f64(&self) -> Option<f64>

If the Value is a f64, returns the associated f64. Returns None otherwise.
source§

fn as_datetime(&self) -> Option<DateTime>

If the Value is a datetime, returns the associated datetime. Returns None otherwise.
source§

fn as_ip_addr(&self) -> Option<Ipv6Addr>

If the Value is a IP address, returns the associated IP. Returns None otherwise.
source§

fn as_bool(&self) -> Option<bool>

If the Value is a bool, returns the associated bool. Returns None otherwise.
source§

fn as_pre_tokenized_text(&self) -> Option<&'a PreTokenizedString>

If the Value is a pre-tokenized string, returns the associated string. Returns None otherwise.
source§

fn as_bytes(&self) -> Option<&'a [u8]>

If the Value is a bytes value, returns the associated set of bytes. Returns None otherwise.
source§

fn as_facet(&self) -> Option<&'a Facet>

If the Value is a facet, returns the associated facet. Returns None otherwise.
source§

fn as_array(&self) -> Option<Self::ArrayIter>

Returns the iterator over the array if the Value is an array.
source§

fn as_object(&self) -> Option<Self::ObjectIter>

Returns the iterator over the object if the Value is an object.
source§

fn is_array(&self) -> bool

Returns true if the Value is an array.
source§

fn is_object(&self) -> bool

Returns true if the Value is an object.
source§

impl ValueDeserialize for OwnedValue

source§

fn deserialize<'de, D>(deserializer: D) -> Result<Self, DeserializeError>
where D: ValueDeserializer<'de>,

Attempts to deserialize Self from a given value deserializer.
source§

impl Eq for OwnedValue

source§

impl StructuralPartialEq for OwnedValue

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

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.
source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

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

fn as_any(&self) -> &(dyn Any + 'static)

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

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

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

impl<T> DowncastSync for T
where T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

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

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

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

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

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

source§

impl<T> Fruit for T
where T: Send + Downcast,