Enum aerospike::Value

source ·
pub enum Value {
    Nil,
    Bool(bool),
    Int(i64),
    UInt(u64),
    Float(FloatValue),
    String(String),
    Blob(Vec<u8>),
    List(Vec<Value>),
    HashMap(HashMap<Value, Value>),
    OrderedMap(Vec<(Value, Value)>),
    GeoJSON(String),
    HLL(Vec<u8>),
}
Expand description

Container for bin values stored in the Aerospike database.

Variants§

§

Nil

Empty value.

§

Bool(bool)

Boolean value.

§

Int(i64)

Integer value. All integers are represented as 64-bit numerics in Aerospike.

§

UInt(u64)

Unsigned integer value. The largest integer value that can be stored in a record bin is i64::max_value(); however the list and map data types can store integer values (and keys) up to u64::max_value().

Panics

Attempting to store an u64 value as a record bin value will cause a panic. Use casting to store and retrieve u64 values.

§

Float(FloatValue)

Floating point value. All floating point values are stored in 64-bit IEEE-754 format in Aerospike. Aerospike server v3.6.0 and later support double data type.

§

String(String)

String value.

§

Blob(Vec<u8>)

Byte array value.

§

List(Vec<Value>)

List data type is an ordered collection of values. Lists can contain values of any supported data type. List data order is maintained on writes and reads.

§

HashMap(HashMap<Value, Value>)

Map data type is a collection of key-value pairs. Each key can only appear once in a collection and is associated with a value. Map keys and values can be any supported data type.

§

OrderedMap(Vec<(Value, Value)>)

Map data type where the map entries are sorted based key ordering (K-ordered maps) and may have an additional value-order index depending the namespace configuration (KV-ordered maps).

§

GeoJSON(String)

GeoJSON data type are JSON formatted strings to encode geospatial information.

§

HLL(Vec<u8>)

HLL value

Implementations§

source§

impl Value

source

pub const fn is_nil(&self) -> bool

Returns true if this value is the empty value (nil).

source

pub fn as_string(&self) -> String

Returns a string representation of the value.

Trait Implementations§

source§

impl Clone for Value

source§

fn clone(&self) -> Value

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 Value

source§

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

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

impl Display for Value

source§

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

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

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

source§

fn from(val: &'a [u8]) -> Value

Converts to this type from the input type.
source§

impl<'a> From<&'a String> for Value

source§

fn from(val: &'a String) -> Value

Converts to this type from the input type.
source§

impl<'a> From<&'a Value> for i64

source§

fn from(val: &'a Value) -> i64

Converts to this type from the input type.
source§

impl<'a> From<&'a Vec<u8, Global>> for Value

source§

fn from(val: &'a Vec<u8>) -> Value

Converts to this type from the input type.
source§

impl<'a> From<&'a bool> for Value

source§

fn from(val: &'a bool) -> Value

Converts to this type from the input type.
source§

impl<'a> From<&'a f32> for Value

source§

fn from(val: &'a f32) -> Value

Converts to this type from the input type.
source§

impl<'a> From<&'a f64> for Value

source§

fn from(val: &'a f64) -> Value

Converts to this type from the input type.
source§

impl<'a> From<&'a i16> for Value

source§

fn from(val: &'a i16) -> Value

Converts to this type from the input type.
source§

impl<'a> From<&'a i32> for Value

source§

fn from(val: &'a i32) -> Value

Converts to this type from the input type.
source§

impl<'a> From<&'a i64> for Value

source§

fn from(val: &'a i64) -> Value

Converts to this type from the input type.
source§

impl<'a> From<&'a i8> for Value

source§

fn from(val: &'a i8) -> Value

Converts to this type from the input type.
source§

impl<'a> From<&'a isize> for Value

source§

fn from(val: &'a isize) -> Value

Converts to this type from the input type.
source§

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

source§

fn from(val: &'a str) -> Value

Converts to this type from the input type.
source§

impl<'a> From<&'a u16> for Value

source§

fn from(val: &'a u16) -> Value

Converts to this type from the input type.
source§

impl<'a> From<&'a u32> for Value

source§

fn from(val: &'a u32) -> Value

Converts to this type from the input type.
source§

impl<'a> From<&'a u64> for Value

source§

fn from(val: &'a u64) -> Value

Converts to this type from the input type.
source§

impl<'a> From<&'a u8> for Value

source§

fn from(val: &'a u8) -> Value

Converts to this type from the input type.
source§

impl<'a> From<&'a usize> for Value

source§

fn from(val: &'a usize) -> Value

Converts to this type from the input type.
source§

impl From<HashMap<Value, Value, RandomState>> for Value

source§

fn from(val: HashMap<Value, Value>) -> Value

Converts to this type from the input type.
source§

impl From<String> for Value

source§

fn from(val: String) -> Value

Converts to this type from the input type.
source§

impl From<Value> for i64

source§

fn from(val: Value) -> i64

Converts to this type from the input type.
source§

impl From<Vec<Value, Global>> for Value

source§

fn from(val: Vec<Value>) -> Value

Converts to this type from the input type.
source§

impl From<Vec<u8, Global>> for Value

source§

fn from(val: Vec<u8>) -> Value

Converts to this type from the input type.
source§

impl From<bool> for Value

source§

fn from(val: bool) -> Value

Converts to this type from the input type.
source§

impl From<f32> for Value

source§

fn from(val: f32) -> Value

Converts to this type from the input type.
source§

impl From<f64> for Value

source§

fn from(val: f64) -> Value

Converts to this type from the input type.
source§

impl From<i16> for Value

source§

fn from(val: i16) -> Value

Converts to this type from the input type.
source§

impl From<i32> for Value

source§

fn from(val: i32) -> Value

Converts to this type from the input type.
source§

impl From<i64> for Value

source§

fn from(val: i64) -> Value

Converts to this type from the input type.
source§

impl From<i8> for Value

source§

fn from(val: i8) -> Value

Converts to this type from the input type.
source§

impl From<isize> for Value

source§

fn from(val: isize) -> Value

Converts to this type from the input type.
source§

impl From<u16> for Value

source§

fn from(val: u16) -> Value

Converts to this type from the input type.
source§

impl From<u32> for Value

source§

fn from(val: u32) -> Value

Converts to this type from the input type.
source§

impl From<u64> for Value

source§

fn from(val: u64) -> Value

Converts to this type from the input type.
source§

impl From<u8> for Value

source§

fn from(val: u8) -> Value

Converts to this type from the input type.
source§

impl From<usize> for Value

source§

fn from(val: usize) -> Value

Converts to this type from the input type.
source§

impl Hash for Value

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<Value> for Value

source§

fn eq(&self, other: &Value) -> 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 TryFrom<Value> for HashMap<Value, Value>

§

type Error = String

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

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for String

§

type Error = String

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

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for Vec<(Value, Value)>

§

type Error = String

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

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for Vec<Value>

§

type Error = String

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

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for Vec<u8>

§

type Error = String

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

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for bool

§

type Error = String

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

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for f64

§

type Error = String

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

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Eq for Value

source§

impl StructuralEq for Value

source§

impl StructuralPartialEq for Value

Auto Trait Implementations§

§

impl RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnwindSafe for Value

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere 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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V