Skip to main content

Value

Enum Value 

Source
pub enum Value {
Show 19 variants None, Null, Bool(bool), Number(Number), String(Strand), Duration(Duration), Datetime(Datetime), Uuid(Uuid), Array(Array), Set(Set), Object(Object), Geometry(Geometry), Bytes(Bytes), Table(TableName), RecordId(RecordId), File(File), Regex(Regex), Range(Box<Range>), Closure(Box<Closure>),
}

Variants§

§

None

§

Null

§

Bool(bool)

§

Number(Number)

§

String(Strand)

§

Duration(Duration)

§

Datetime(Datetime)

§

Uuid(Uuid)

§

Array(Array)

§

Set(Set)

§

Object(Object)

§

Geometry(Geometry)

§

Bytes(Bytes)

§

Table(TableName)

§

RecordId(RecordId)

§

File(File)

§

Regex(Regex)

§

Range(Box<Range>)

§

Closure(Box<Closure>)

Implementations§

Source§

impl Value

Source

pub fn all(&self) -> Self

Returns the equivalent of self.pick(&[Part::All])

Source§

impl Value

Source

pub fn compare( &self, other: &Self, path: &[Part], collate: bool, numeric: bool, ) -> Option<Ordering>

Source§

impl Value

Source

pub fn cut(&mut self, path: &[Part])

Synchronous method for deleting a field from a Value

Source§

impl Value

Source

pub fn def(&mut self, val: RecordId)

Source§

impl Value

Source

pub fn diff(&self, val: &Value) -> Vec<Operation>

Source§

impl Value

Source

pub fn each(&self, path: &[Part]) -> Vec<Idiom>

Widens an idiom into a list of idioms with the given object. Resolving .* to all the different fields or indexes in that position.

For example a.*.* with the object { a: { b: [1,2], c: 1} } resolves to a.b[0], a.b[1], a.c. and a.$ with object { a: [1,2,3] } resolves to a[2].

Source§

impl Value

Source

pub fn every( &self, path: Option<&[Part]>, steps: bool, behavior: ArrayBehaviour, ) -> Vec<Idiom>

Returns a list of idioms for then entries of a possibly nested value.

Exact behavior of this function is dictated by the ArrayBehaviour param and steps. Steps enables intermediate idioms instead of only the leaf values. For the changes in behavior with ArrayBehaviour see the docs for that enum.

Source§

impl Value

Source

pub fn first(&self) -> Self

Source§

impl Value

Source

pub fn flatten(self) -> Self

Source§

impl Value

Source

pub fn generate(self, tb: TableName, retable: bool) -> Result<RecordId>

Source§

impl Value

Source

pub fn inc(&mut self, path: &[Part], val: Value) -> Result<()>

Synchronous method for incrementing a field in a Value

Source§

impl Value

Source

pub fn merge(&mut self, val: Value) -> Result<()>

Source§

impl Value

Source

pub fn patch(&mut self, ops: Value) -> Result<()>

Source§

impl Value

Source

pub fn pick(&self, path: &[Part]) -> Self

Synchronous method for getting a field from a Value

Source§

impl Value

Source

pub fn put(&mut self, path: &[Part], val: Value)

Synchronous method for setting a field on a Value

Source§

impl Value

Source

pub fn replace(&mut self, val: Value) -> Result<()>

Source§

impl Value

Source

pub fn rid(&self) -> Value

Source§

impl Value

Source

pub fn set_at_field_path_owned(&mut self, path: &FieldPath, val: Value)

Synchronous method for setting a value at a FieldPath, consuming val.

Unlike set(), this doesn’t require async/computation - just navigation. When encountering an array, applies the remaining path to all elements (cloning val for all-but-last and moving into the last). Otherwise val is moved straight to the leaf assignment. This is used for output path navigation in the projection operator, where each computed field value is produced fresh and would otherwise be cloned into the output.

Source§

impl Value

Source

pub fn walk(&self, path: &[Part]) -> Vec<(Idiom, Self)>

Source

pub fn walk_ref(&self, path: &[Part], visit: &mut impl FnMut(&Self))

Visits every value Value::walk would return, in the same order, by reference.

walk answers with owned values and the paths that name them, so a caller that only measures what it finds deep-clones every match — a whole array for an array field — and drops it again. This is the same traversal with the path and the clone left out, and the two must stay in step: a measurement taken here has to be a measurement of what a caller reading walk would see.

Source§

impl Value

Source

pub fn can_cast_to<T: Cast>(&self) -> bool

Source

pub fn can_cast_to_kind(&self, kind: &Kind) -> bool

Source

pub fn cast_to<T: Cast>(self) -> Result<T, CastError>

Source

pub fn cast_to_kind(self, kind: &Kind) -> Result<Value, CastError>

Try to convert this value to the specified Kind

Source

pub fn cast_to_literal(self, literal: &KindLiteral) -> Result<Value, CastError>

Try to convert this value to a Literal, returns a Value with the coerced value

Source

pub fn cast_to_set_type(self, kind: &Kind) -> Result<Set, CastError>

Try to convert this value to a Set of a certain type

Source

pub fn cast_to_set_type_len( self, kind: &Kind, len: u64, ) -> Result<Set, CastError>

Try to convert this value to a Set of a certain type and length

Source

pub fn cast_to_file_buckets(self, buckets: &[String]) -> Result<File, CastError>

Source§

impl Value

Source

pub fn can_coerce_to<T: Coerce>(&self) -> bool

Source

pub fn can_coerce_to_kind(&self, kind: &Kind) -> bool

Source

pub fn coerce_to<T: Coerce>(self) -> Result<T, CoerceError>

Convert the value using coercion rules.

Coercion rules are more strict then coverting rules. Calling this method will succeed if the value can by unified with the kind of the target

This method is a shorthand for T::coerce(self)

Source

pub fn coerce_to_kind(self, kind: &Kind) -> Result<Value, CoerceError>

Try to coerce this value to the specified Kind

Source

pub fn coerce_to_literal( self, literal: &KindLiteral, ) -> Result<Value, CoerceError>

Try to coerce this value to a Literal, returns a Value with the coerced value

Source

pub fn coerce_to_table_kind( self, val: &[TableName], ) -> Result<TableName, CoerceError>

Try to coerce this value to a Table of a certain type

Source

pub fn coerce_to_record_kind( self, val: &[TableName], ) -> Result<RecordId, CoerceError>

Try to coerce this value to a Record of a certain type

Source

pub fn coerce_to_geometry_kind( self, val: &[GeometryKind], ) -> Result<Geometry, CoerceError>

Try to coerce this value to a Geometry of a certain type

Source

pub fn coerce_to_array_type(self, kind: &Kind) -> Result<Array, CoerceError>

Try to coerce this value to an Array of a certain type

Source

pub fn coerce_to_array_type_len( self, kind: &Kind, len: u64, ) -> Result<Array, CoerceError>

Try to coerce this value to an Array of a certain type, and length

Source

pub fn coerce_to_set_kind(self, kind: &Kind) -> Result<Set, CoerceError>

Try to coerce this value to a Set of a certain type

Source

pub fn coerce_to_set_kind_len( self, kind: &Kind, len: u64, ) -> Result<Set, CoerceError>

Try to coerce this value to a Set of a certain type and length

Source

pub fn coerce_to_file_buckets( self, buckets: &[String], ) -> Result<File, CoerceError>

Source§

impl Value

Source

pub fn walk_revisioned_variant_name( wire_revision: u16, discriminant: u32, ) -> Option<&'static str>

Resolve a wire discriminant at wire_revision to the variant identifier at that revision. Returns None if no such variant exists at that revision.

Generated by the revisioned derive.

Source

pub fn walk_revisioned_variant_table( wire_revision: u16, ) -> &'static [(&'static str, u32)]

Variant name + discriminant pairs at wire_revision. Returns an empty slice if the revision is unknown. Generated by the revisioned derive.

Source§

impl Value

Source

pub const REVISION: u16 = 2u16

The revision number of this type, as declared via #[revisioned(revision = N)].

Source§

impl Value

Source

pub const NONE: Self = Self::None

Source

pub fn hash_agrees_with_eq(&self) -> bool

Whether a HashMap/HashSet miss on this value proves the collection does not hold it — i.e. whether this value’s Hash is consistent with its PartialEq.

Number is the one leaf where the two disagree, and it cannot be repaired: see Number’s Hash impl for why. A value that can reach a Number may hash into a different bucket than an equal value, so contains answers false for something the collection holds.

A probe is decisive as soon as either side is number-free, because equality requires matching variants at every level: two values can only hash apart while comparing equal if both carry a Number in the same position. So a caller may trust a miss when this returns true for the probed value, or when it returns true for every element of the collection.

Variants whose hash/equality pairing is not established — Value::Geometry (hashes f64 coordinates), Value::Regex (equality with Value::String is asymmetric), Value::Range and Value::Closure — report false so they take the same conservative path.

Source

pub fn empty_object() -> Self

Create an empty Object Value

Source

pub fn is_some(&self) -> bool

Check if this Value is not NONE

Source

pub fn is_nullish(&self) -> bool

Check if this Value is NONE or NULL

Source

pub fn is_empty_array(&self) -> bool

Check if this Value is NONE

Source

pub fn is_truthy(&self) -> bool

Check if this Value is truthy

Source

pub fn is_int(&self) -> bool

Check if this Value is an int Number

Source

pub fn is_float(&self) -> bool

Check if this Value is a float Number

Source

pub fn is_decimal(&self) -> bool

Check if this Value is a decimal Number

Source

pub fn is_record_type(&self, types: &[TableName]) -> bool

Check if this Value is a RecordId of a specific type

Source

pub fn is_geometry_type(&self, types: &[GeometryKind]) -> bool

Check if this Value is a Geometry of a specific type

Source

pub fn into_raw_string(self) -> String

Converts this Value into an unquoted String

Source

pub fn to_raw_string(&self) -> String

Converts this Value into an unquoted String

Source

pub fn kind_of(&self) -> &'static str

Returns the surql representation of the kind of the value as a string.

§Warning

This function is not fully implement for all variants, make sure you don’t accidentally use it where it can return an invalid value.

Source

pub fn equal(&self, other: &Value) -> bool

Check if this Value is equal to another Value

Source

pub fn all_equal(&self, other: &Value) -> bool

Check if all Values in an Array are equal to another Value

Source

pub fn any_equal(&self, other: &Value) -> bool

Check if any Values in an Array are equal to another Value

Source

pub fn contains(&self, other: &Value) -> bool

Check if this Value contains another Value

Source

pub fn contains_all(&self, other: &Value) -> bool

Check if all Values in an Array, Set or String contain another Value

Source

pub fn contains_any(&self, other: &Value) -> bool

Check if any Values in an Array, Set or String contain another Value

Source

pub fn intersects(&self, other: &Value) -> bool

Check if this Geometry intersects another Value

Source

pub fn lexical_cmp(&self, other: &Value) -> Option<Ordering>

Compare this Value to another Value lexicographically

Source

pub fn natural_cmp(&self, other: &Value) -> Option<Ordering>

Compare this Value to another Value using natural numerical comparison

Source

pub fn natural_lexical_cmp(&self, other: &Value) -> Option<Ordering>

Compare this Value to another Value lexicographically and using natural numerical comparison

Source

pub fn into_literal(self) -> Expr

Turns this value into a literal evaluating to the same value.

Source§

impl Value

Source

pub fn is_none(&self) -> bool

Check if the value is a None

Source

pub fn is_null(&self) -> bool

Check if the value is a Null

Source

pub fn is_bool(&self) -> bool

Check if the value is a [Bool]

Source

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

Return a reference to [Bool] if the value is of that type

Source

pub fn into_bool(self) -> Option<bool>

Turns the value into a [Bool] returning None if the value is not of that type

Source

pub fn is_number(&self) -> bool

Check if the value is a Number

Source

pub fn as_number(&self) -> Option<&Number>

Return a reference to Number if the value is of that type

Source

pub fn into_number(self) -> Option<Number>

Turns the value into a Number returning None if the value is not of that type

Source

pub fn is_strand(&self) -> bool

Check if the value is a String

Source

pub fn as_strand(&self) -> Option<&Strand>

Return a reference to String if the value is of that type

Source

pub fn into_strand(self) -> Option<Strand>

Turns the value into a String returning None if the value is not of that type

Source

pub fn is_table(&self) -> bool

Check if the value is a [Table]

Source

pub fn as_table(&self) -> Option<&TableName>

Return a reference to [Table] if the value is of that type

Source

pub fn into_table(self) -> Option<TableName>

Turns the value into a [Table] returning None if the value is not of that type

Source

pub fn is_duration(&self) -> bool

Check if the value is a Duration

Source

pub fn as_duration(&self) -> Option<&Duration>

Return a reference to Duration if the value is of that type

Source

pub fn into_duration(self) -> Option<Duration>

Turns the value into a Duration returning None if the value is not of that type

Source

pub fn is_datetime(&self) -> bool

Check if the value is a Datetime

Source

pub fn as_datetime(&self) -> Option<&Datetime>

Return a reference to Datetime if the value is of that type

Source

pub fn into_datetime(self) -> Option<Datetime>

Turns the value into a Datetime returning None if the value is not of that type

Source

pub fn is_uuid(&self) -> bool

Check if the value is a Uuid

Source

pub fn as_uuid(&self) -> Option<&Uuid>

Return a reference to Uuid if the value is of that type

Source

pub fn into_uuid(self) -> Option<Uuid>

Turns the value into a Uuid returning None if the value is not of that type

Source

pub fn is_array(&self) -> bool

Check if the value is a Array

Source

pub fn as_array(&self) -> Option<&Array>

Return a reference to Array if the value is of that type

Source

pub fn into_array(self) -> Option<Array>

Turns the value into a Array returning None if the value is not of that type

Source

pub fn is_set(&self) -> bool

Check if the value is a Set

Source

pub fn as_set(&self) -> Option<&Set>

Return a reference to Set if the value is of that type

Source

pub fn into_set(self) -> Option<Set>

Turns the value into a Set returning None if the value is not of that type

Source

pub fn is_object(&self) -> bool

Check if the value is a Object

Source

pub fn as_object(&self) -> Option<&Object>

Return a reference to Object if the value is of that type

Source

pub fn into_object(self) -> Option<Object>

Turns the value into a Object returning None if the value is not of that type

Source

pub fn is_geometry(&self) -> bool

Check if the value is a Geometry

Source

pub fn as_geometry(&self) -> Option<&Geometry>

Return a reference to Geometry if the value is of that type

Source

pub fn into_geometry(self) -> Option<Geometry>

Turns the value into a Geometry returning None if the value is not of that type

Source

pub fn is_bytes(&self) -> bool

Check if the value is a Bytes

Source

pub fn as_bytes(&self) -> Option<&Bytes>

Return a reference to Bytes if the value is of that type

Source

pub fn into_bytes(self) -> Option<Bytes>

Turns the value into a Bytes returning None if the value is not of that type

Source

pub fn is_record(&self) -> bool

Check if the value is a RecordId

Source

pub fn as_record(&self) -> Option<&RecordId>

Return a reference to RecordId if the value is of that type

Source

pub fn into_record(self) -> Option<RecordId>

Turns the value into a RecordId returning None if the value is not of that type

Source

pub fn is_regex(&self) -> bool

Check if the value is a Regex

Source

pub fn as_regex(&self) -> Option<&Regex>

Return a reference to Regex if the value is of that type

Source

pub fn into_regex(self) -> Option<Regex>

Turns the value into a Regex returning None if the value is not of that type

Source

pub fn is_range(&self) -> bool

Check if the value is a Range

Source

pub fn as_range(&self) -> Option<&Box<Range>>

Return a reference to Range if the value is of that type

Source

pub fn into_range(self) -> Option<Box<Range>>

Turns the value into a Range returning None if the value is not of that type

Source

pub fn is_closure(&self) -> bool

Check if the value is a Closure

Source

pub fn as_closure(&self) -> Option<&Box<Closure>>

Return a reference to Closure if the value is of that type

Source

pub fn into_closure(self) -> Option<Box<Closure>>

Turns the value into a Closure returning None if the value is not of that type

Source

pub fn is_file(&self) -> bool

Check if the value is a File

Source

pub fn as_file(&self) -> Option<&File>

Return a reference to File if the value is of that type

Source

pub fn into_file(self) -> Option<File>

Turns the value into a File returning None if the value is not of that type

Trait Implementations§

Source§

impl<'de> BorrowDecode<'de, IndexFormat> for Value

Source§

impl<'de> BorrowDecode<'de> for Value

Source§

impl Cast for Value

Source§

fn can_cast(_: &Value) -> bool

Returns true if calling cast on the value will succeed. Read more
Source§

fn cast(v: Value) -> Result<Self, CastError>

Cast a value to the self type.
Source§

impl Clone for Value

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Coerce for Value

Source§

fn can_coerce(_: &Value) -> bool

Returns if calling coerce on the value will succeed or not. Read more
Source§

fn coerce(v: Value) -> Result<Self, CoerceError>

Coerce a value.
Source§

impl Debug for Value

Source§

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

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

impl Default for Value

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl DeserializeRevisioned for Value

Source§

fn deserialize_revisioned<R: Read>(reader: &mut R) -> Result<Self, Error>

Deserializes a new instance of the struct from the specified reader.
Source§

impl Encode for Value

Source§

fn encode<W: Write>(&self, _w: &mut Writer<W>) -> Result<(), EncodeError>

Source§

impl Encode<IndexFormat> for Value

Source§

fn encode<W: Write>(&self, _w: &mut Writer<W>) -> Result<(), EncodeError>

Source§

impl Eq for Value

Source§

impl From<&str> for Value

Source§

fn from(v: &str) -> Self

Converts to this type from the input type.
Source§

impl From<Array> for Value

Source§

fn from(v: Array) -> Self

Converts to this type from the input type.
Source§

impl From<BTreeMap<&str, Value>> for Value

Source§

fn from(v: BTreeMap<&str, Value>) -> Self

Converts to this type from the input type.
Source§

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

Source§

fn from(v: BTreeMap<String, Value>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<Closure>> for Value

Source§

fn from(v: Box<Closure>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<Range>> for Value

Source§

fn from(v: Box<Range>) -> Self

Converts to this type from the input type.
Source§

impl From<Bytes> for Value

Source§

fn from(v: Bytes) -> Self

Converts to this type from the input type.
Source§

impl From<Closure> for Value

Source§

fn from(v: Closure) -> Self

Converts to this type from the input type.
Source§

impl From<DateTime<Utc>> for Value

Source§

fn from(v: DateTime<Utc>) -> Self

Converts to this type from the input type.
Source§

impl From<Datetime> for Value

Source§

fn from(v: Datetime) -> Self

Converts to this type from the input type.
Source§

impl From<Decimal> for Value

Source§

fn from(v: Decimal) -> Self

Converts to this type from the input type.
Source§

impl From<Duration> for Value

Source§

fn from(value: Duration) -> Self

Converts to this type from the input type.
Source§

impl From<Duration> for Value

Source§

fn from(v: Duration) -> Self

Converts to this type from the input type.
Source§

impl From<File> for Value

Source§

fn from(v: File) -> Self

Converts to this type from the input type.
Source§

impl From<Geometry> for Value

Source§

fn from(v: Geometry) -> Self

Converts to this type from the input type.
Source§

impl From<HashMap<&str, Value>> for Value

Source§

fn from(v: HashMap<&str, Value>) -> Self

Converts to this type from the input type.
Source§

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

Source§

fn from(v: HashMap<String, Value>) -> Self

Converts to this type from the input type.
Source§

impl From<Null> for Value

Source§

fn from(_v: Null) -> Self

Converts to this type from the input type.
Source§

impl From<Number> for Value

Source§

fn from(v: Number) -> Self

Converts to this type from the input type.
Source§

impl From<Object> for Value

Source§

fn from(v: Object) -> Self

Converts to this type from the input type.
Source§

impl From<Point> for Value

Source§

fn from(v: Point<f64>) -> Self

Converts to this type from the input type.
Source§

impl From<Range> for Value

Source§

fn from(v: Range) -> Self

Converts to this type from the input type.
Source§

impl From<RecordId> for Value

Source§

fn from(v: RecordId) -> Self

Converts to this type from the input type.
Source§

impl From<Regex> for Value

Source§

fn from(v: Regex) -> Self

Converts to this type from the input type.
Source§

impl From<Set> for Value

Source§

fn from(v: Set) -> Self

Converts to this type from the input type.
Source§

impl From<Strand> for Value

Source§

fn from(v: Strand) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Value

Source§

fn from(v: String) -> Self

Converts to this type from the input type.
Source§

impl From<TableName> for Value

Source§

fn from(v: TableName) -> Self

Converts to this type from the input type.
Source§

impl From<Uuid> for Value

Source§

fn from(v: Uuid) -> Self

Converts to this type from the input type.
Source§

impl From<Uuid> for Value

Source§

fn from(v: Uuid) -> Self

Converts to this type from the input type.
Source§

impl From<Value> for Value

Source§

fn from(s: PublicValue) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Value>> for Value

Source§

fn from(value: Vec<Value>) -> Self

Converts to this type from the input type.
Source§

impl From<VecMap<&str, Value>> for Value

Source§

fn from(v: VecMap<&str, Value>) -> Self

Converts to this type from the input type.
Source§

impl From<VecMap<Strand, Value>> for Value

Source§

fn from(v: VecMap<Strand, Value>) -> Self

Converts to this type from the input type.
Source§

impl From<VecMap<String, Value>> for Value

Source§

fn from(v: VecMap<String, Value>) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for Value

Source§

fn from(v: bool) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for Value

Source§

fn from(v: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for Value

Source§

fn from(v: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for Value

Source§

fn from(v: i8) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for Value

Source§

fn from(v: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for Value

Source§

fn from(v: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for Value

Source§

fn from(v: i64) -> Self

Converts to this type from the input type.
Source§

impl From<isize> for Value

Source§

fn from(v: isize) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Value

Source§

fn from(v: u8) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for Value

Source§

fn from(v: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for Value

Source§

fn from(v: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for Value

Source§

fn from(v: u64) -> Self

Converts to this type from the input type.
Source§

impl From<usize> for Value

Source§

fn from(v: usize) -> Self

Converts to this type from the input type.
Source§

impl FromIterator<(String, Value)> for Value

Source§

fn from_iter<I: IntoIterator<Item = (String, Value)>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<Value> for Array

Source§

fn from_iter<I: IntoIterator<Item = Value>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<Value> for Set

Source§

fn from_iter<I: IntoIterator<Item = Value>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl FromIterator<Value> for Value

Source§

fn from_iter<I: IntoIterator<Item = Value>>(iter: I) -> Self

Creates a value from an iterator. Read more
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 InfoStructure for Value

Source§

impl Ord for Value

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for Value

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialEq<Value> for RecordIdKey

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialOrd for Value

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Revisioned for Value

Source§

fn revision() -> u16

Returns the current revision of this type.
Source§

fn type_id() -> TypeId
where Self: 'static,

Returns the type id of this type.
Source§

impl SerializeRevisioned for Value

Source§

fn serialize_revisioned<W: Write>(&self, writer: &mut W) -> Result<(), Error>

Serializes the struct using the specified writer.
Source§

impl SkipCheckRevisioned for Value

Source§

impl SkipRevisioned for Value

Source§

fn skip_revisioned<R: Read>(reader: &mut R) -> Result<(), Error>

Source§

fn skip_revisioned_slice(reader: &mut SliceReader<'_>) -> Result<(), Error>

Consume through bytes backed by SliceReader without allocating a buffer for bulk segments. Read more
Source§

impl StructuralPartialEq for Value

Source§

impl ToSql for Value

Source§

fn fmt_sql(&self, f: &mut String, sql_fmt: SqlFormat)

Format the type to a SQL string.
Source§

fn to_sql(&self) -> String

Convert the type to a SQL string.
Source§

fn to_sql_pretty(&self) -> String

Convert the type to a pretty-printed SQL string with indentation.
Source§

impl TryAdd for Value

Source§

type Output = Value

Source§

fn try_add(self, other: Self) -> Result<Self>

Source§

impl TryDiv for Value

Source§

type Output = Value

Source§

fn try_div(self, other: Self) -> Result<Self>

Source§

impl TryFloatDiv for Value

Source§

type Output = Value

Source§

fn try_float_div(self, other: Self) -> Result<Self::Output>

Source§

impl TryFrom<Value> for PublicValue

Source§

type Error = Error

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

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

Performs the conversion.
Source§

impl TryFrom<i128> for Value

Source§

type Error = Error

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

fn try_from(v: i128) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u128> for Value

Source§

type Error = Error

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

fn try_from(v: u128) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryMul for Value

Source§

type Output = Value

Source§

fn try_mul(self, other: Self) -> Result<Self>

Source§

impl TryNeg for Value

Source§

type Output = Value

Source§

fn try_neg(self) -> Result<Self>

Source§

impl TryPow for Value

Source§

type Output = Value

Source§

fn try_pow(self, other: Self) -> Result<Self>

Source§

impl TryRem for Value

Source§

type Output = Value

Source§

fn try_rem(self, other: Self) -> Result<Self>

Source§

impl TrySub for Value

Source§

type Output = Value

Source§

fn try_sub(self, other: Self) -> Result<Self>

Source§

impl WalkRevisioned for Value

Source§

type Walker<'r, R: BorrowedReader + 'r> = ValueWalker<'r, R>

Walker produced by walk_revisioned. Read more
Source§

fn walk_revisioned<'r, R: BorrowedReader>( reader: &'r mut R, ) -> Result<Self::Walker<'r, R>, Error>

Read the type’s revision-level prefix and return a walker positioned at the start of the body. Read more

Auto Trait Implementations§

§

impl !Freeze for Value

§

impl !RefUnwindSafe for Value

§

impl !UnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnsafeUnpin for Value

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<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>, U: Sized,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

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

Source§

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

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SetEntry<T> for T
where T: Hash + Eq,

Source§

fn into_owned(self) -> T

Source§

fn equal(&self, other: &T) -> bool

Source§

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

Source§

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>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool