Skip to main content

Value

Enum Value 

Source
pub enum Value {
    Bool(bool),
    Int(i64),
    Uint(u64),
    BigInt(BigInt),
    Float(f64),
    Str(String),
    Inst(DateTime<Utc>),
    Dur(TimeDelta),
    UUID([u8; 16]),
    Arr(Vec<Value>),
    Map(Box<HashMap<Key, Value>>),
    UnitVar(String),
}
Expand description

type representing a structom value.

Values are wrappers that represent any structom value, builtin or user defined.

they can be created manually or from source or binary, manipulated or converted to native types, and stringified or serialized.

§api

Value can be created through different forms

// manually
Value::from(1) // => Uint(1)

// from source
parse("1", &ParseOptions::default(), &VoidProvider{}); // => Uint(1)

// from binary
decode(&[0, 16, 1], &VoidProvider{}); // => Uint(1)

Value has different methods for manipulation its value.

let value = Value::Uint(1);

// test type
value.is_uint(); // => true

// get ref to inner value
value.as_uint(); // => Some(1)

// compare inner value
value == 1; // => true

// index for array and map
Value::from(vec![1, 2, 3])[1] // => Uint(2)

Value can be transformed into other forms.

let value = Value::Uint(1);

// convert to native type
value.cast<u64>(); // => Ok(1)

// stringify into object notation
stringify(value, &StringifyOptions::default()); // => "1"

// encode into binary
encode(value); // => [0, 16, 1]

§representation

builtin types are represented through their respective variant.

structs are represented through the Map variant containing the struct fields.

enums are represented by the UnitVar case it is unit variant.
else they are represented by a Map variant containing the fields, with a special key Key::enum_variant_key() storing the variant name.

for metadata wrapped types, they are represented by a Map variant containing the metadata with their values, with special keys: Key::has_meta_key() of value true and Key::inner_key() containing the wrapped value.

Variants§

§

Bool(bool)

boolean value, types: bool.

§

Int(i64)

signed integer value, types: i8, i16, i32, i64 vint.

§

Uint(u64)

unsigned integer value, types: u8, u16, u32, u64 vuint.

§

BigInt(BigInt)

big integer value, types: bint.

§

Float(f64)

floating point value, types: f32, f64

§

Str(String)

string value, types: str.

§

Inst(DateTime<Utc>)

instance value, types: inst, instN.

§

Dur(TimeDelta)

duration value, types: dur.

§

UUID([u8; 16])

uuid value, types: uuid.

§

Arr(Vec<Value>)

array value, types: arr.

§

Map(Box<HashMap<Key, Value>>)

map value, types: map, structs, enums with fields.

§

UnitVar(String)

unit variant enum, types: enum.

Implementations§

Source§

impl Value

is_T() -> bool: whether the inner value is of type T.

Source

pub fn is_bool(&self) -> bool

Source

pub fn is_uint(&self) -> bool

Source

pub fn is_int(&self) -> bool

Source

pub fn is_str(&self) -> bool

Source

pub fn is_bigint(&self) -> bool

Source

pub fn is_float(&self) -> bool

Source

pub fn is_inst(&self) -> bool

Source

pub fn is_dur(&self) -> bool

Source

pub fn is_uuid(&self) -> bool

Source

pub fn is_array(&self) -> bool

Source

pub fn is_map(&self) -> bool

Source

pub fn is_unit_variant(&self) -> bool

Source

pub fn is_enum(&self) -> bool

whether the inner value is an enum

Source

pub fn has_meta(&self) -> bool

whether the inner value is a metadata wrapped type

Source§

impl Value

Source

pub fn into_key(self) -> Option<Key>

convert Value into Key

Source

pub fn enum_variant(&self) -> Option<&str>

get name of the wrapped enum variant, if not enum return None.

Source

pub fn inner(&self) -> &Value

get the inner value of a metadata wrapped type, else return self.

Source

pub fn inner_mut(&mut self) -> &mut Value

get mut ref to the inner value of a metadata wrapped type, else return self.

Source

pub fn into_inner(self) -> Value

unwrap the inner value of a metadata wrapped type, else return self.

Source§

impl Value

Source

pub fn map_from<K: Into<Key>, V: Into<Value>, I: IntoIterator<Item = (K, V)>>( iter: I, ) -> Value

Source§

impl Value

Source

pub fn cast<T>(self) -> Option<T>
where Value: TryInto<T>,

cast value into T

Source§

impl Value

as_T() -> Option<T>: get copy / reference of the inner value if it is of type T, else None.

as_mut_T() -> Option<T>: get mutable reference to the inner value if it is of type T, else None.

Source

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

Source

pub fn as_int(&self) -> Option<i64>

Source

pub fn as_uint(&self) -> Option<u64>

Source

pub fn as_float(&self) -> Option<f64>

Source

pub fn as_uuid(&self) -> Option<[u8; 16]>

Source

pub fn as_dur(&self) -> Option<TimeDelta>

Source

pub fn as_inst(&self) -> Option<DateTime<Utc>>

Source

pub fn as_str(&self) -> Option<&str>

Source

pub fn as_slice(&self) -> Option<&[Value]>

Source

pub fn as_bigint(&self) -> Option<&BigInt>

Source

pub fn as_map(&self) -> Option<&HashMap<Key, Value>>

Source

pub fn as_vec_mut(&mut self) -> Option<&mut Vec<Value>>

Source

pub fn as_map_mut(&mut self) -> Option<&mut HashMap<Key, Value>>

Source§

impl Value

Source

pub fn index_arr<I: SliceIndex<[Value]>>( &self, index: I, ) -> Option<&<I as SliceIndex<[Value]>>::Output>

get an item by index if value is an array, else return None.

Source

pub fn index_arr_mut<I: SliceIndex<[Value]>>( &mut self, index: I, ) -> Option<&mut <I as SliceIndex<[Value]>>::Output>

get a mutable reference to an item by index if value is an array, else return None.

Source

pub fn index_map(&self, key: &Key) -> Option<&Value>

get an item by key if value is a map, else return None.

Source

pub fn index_map_mut(&mut self, key: &Key) -> Option<&mut Value>

get a mutable reference to an item by key if value is a map, else return None.

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Value

Returns a duplicate 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 Default for Value

Source§

fn default() -> Self

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

impl Display for Value

Source§

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

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

impl From<&str> for Value

Source§

fn from(s: &str) -> Self

Converts to this type from the input type.
Source§

impl From<[u8; 16]> for Value

Source§

fn from(v: [u8; 16]) -> Self

Converts to this type from the input type.
Source§

impl From<BigInt> for Value

Source§

fn from(v: BigInt) -> 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<K: Into<Key>, V: Into<Value>> From<HashMap<K, V>> for Value

Source§

fn from(m: HashMap<K, V>) -> Self

Converts to this type from the input type.
Source§

impl From<Key> for Value

Source§

fn from(key: Key) -> 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<TimeDelta> for Value

Source§

fn from(v: TimeDelta) -> Self

Converts to this type from the input type.
Source§

impl<T: Into<Value>> From<Vec<T>> for Value

Source§

fn from(v: Vec<T>) -> 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<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<i8> for Value

Source§

fn from(v: i8) -> 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<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<u8> for Value

Source§

fn from(v: u8) -> 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 Index<&Key> for Value

Source§

type Output = Value

The returned type after indexing.
Source§

fn index(&self, index: &Key) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<I: SliceIndex<[Value]>> Index<I> for Value

Source§

type Output = <I as SliceIndex<[Value]>>::Output

The returned type after indexing.
Source§

fn index(&self, index: I) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<&Key> for Value

Source§

fn index_mut(&mut self, index: &Key) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<I: SliceIndex<[Value]>> IndexMut<I> for Value

Source§

fn index_mut(&mut self, index: I) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl PartialEq<&str> for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 16]> for Value

Source§

fn eq(&self, other: &[u8; 16]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<BigInt> for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<DateTime<Utc>> for Value

Source§

fn eq(&self, other: &DateTime<Utc>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<Key> for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<String> for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<TimeDelta> for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> PartialEq<Vec<T>> for Value
where Value: PartialEq<T>,

Source§

fn eq(&self, other: &Vec<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<bool> for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<f64> for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<i16> for &Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<i16> for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<i32> for &Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<i32> for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<i64> for &Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<i64> for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<i8> for &Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<i8> for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<isize> for &Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<isize> for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<u16> for &Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<u16> for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<u32> for &Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<u32> for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<u64> for &Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<u64> for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<u8> for &Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<u8> for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<usize> for &Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<usize> for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for Value

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<Value> for Key

Source§

type Error = ()

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

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

Performs the conversion.
Source§

impl TryInto<[u8; 16]> for Value

Source§

type Error = ()

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

fn try_into(self) -> Result<[u8; 16], Self::Error>

Performs the conversion.
Source§

impl TryInto<BigInt> for Value

Source§

type Error = ()

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

fn try_into(self) -> Result<BigInt, Self::Error>

Performs the conversion.
Source§

impl TryInto<DateTime<Utc>> for Value

Source§

type Error = ()

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

fn try_into(self) -> Result<DateTime<Utc>, Self::Error>

Performs the conversion.
Source§

impl<K, V> TryInto<HashMap<K, V>> for Value
where Key: TryInto<K>, Value: TryInto<V>, K: Eq + Hash,

Source§

type Error = ()

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

fn try_into(self) -> Result<HashMap<K, V>, Self::Error>

Performs the conversion.
Source§

impl TryInto<String> for Value

Source§

type Error = ()

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

fn try_into(self) -> Result<String, Self::Error>

Performs the conversion.
Source§

impl TryInto<TimeDelta> for Value

Source§

type Error = ()

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

fn try_into(self) -> Result<TimeDelta, Self::Error>

Performs the conversion.
Source§

impl<T> TryInto<Vec<T>> for Value
where Value: TryInto<T>,

Source§

type Error = ()

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

fn try_into(self) -> Result<Vec<T>, Self::Error>

Performs the conversion.
Source§

impl TryInto<bool> for Value

Source§

type Error = ()

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

fn try_into(self) -> Result<bool, Self::Error>

Performs the conversion.
Source§

impl TryInto<f32> for Value

Source§

type Error = ()

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

fn try_into(self) -> Result<f32, Self::Error>

Performs the conversion.
Source§

impl TryInto<f64> for Value

Source§

type Error = ()

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

fn try_into(self) -> Result<f64, Self::Error>

Performs the conversion.
Source§

impl TryInto<i16> for Value

Source§

type Error = ()

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

fn try_into(self) -> Result<i16, Self::Error>

Performs the conversion.
Source§

impl TryInto<i32> for Value

Source§

type Error = ()

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

fn try_into(self) -> Result<i32, Self::Error>

Performs the conversion.
Source§

impl TryInto<i64> for Value

Source§

type Error = ()

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

fn try_into(self) -> Result<i64, Self::Error>

Performs the conversion.
Source§

impl TryInto<i8> for Value

Source§

type Error = ()

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

fn try_into(self) -> Result<i8, Self::Error>

Performs the conversion.
Source§

impl TryInto<isize> for Value

Source§

type Error = ()

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

fn try_into(self) -> Result<isize, Self::Error>

Performs the conversion.
Source§

impl TryInto<u16> for Value

Source§

type Error = ()

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

fn try_into(self) -> Result<u16, Self::Error>

Performs the conversion.
Source§

impl TryInto<u32> for Value

Source§

type Error = ()

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

fn try_into(self) -> Result<u32, Self::Error>

Performs the conversion.
Source§

impl TryInto<u64> for Value

Source§

type Error = ()

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

fn try_into(self) -> Result<u64, Self::Error>

Performs the conversion.
Source§

impl TryInto<u8> for Value

Source§

type Error = ()

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

fn try_into(self) -> Result<u8, Self::Error>

Performs the conversion.
Source§

impl TryInto<usize> for Value

Source§

type Error = ()

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

fn try_into(self) -> Result<usize, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl Freeze for Value

§

impl RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnsafeUnpin for Value

§

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

Source§

fn to_string(&self) -> String

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

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

Source§

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

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.