Enum air_test_utils::prelude::JValue

source ·
pub enum JValue {
    Null,
    Bool(bool),
    Number(Number),
    String(Rc<str>),
    Array(Rc<[JValue]>),
    Object(Rc<BTreeMap<Rc<str>, JValue>>),
}
Expand description

Represents any valid JSON value with a cheap to clone Rc-based representation.

Variants§

§

Null

Represents a JSON null value.

§

Bool(bool)

Represents a JSON boolean.

§

Number(Number)

Represents a JSON number, whether integer or floating point.

§

String(Rc<str>)

Represents a JSON string.

§

Array(Rc<[JValue]>)

Represents a JSON array.

§

Object(Rc<BTreeMap<Rc<str>, JValue>>)

Represents a JSON object.

By default the map is backed by a BTreeMap. Enable the preserve_order feature of serde_json to use IndexMap instead, which preserves entries in the order they are inserted into the map. In particular, this allows JSON data to be deserialized into a JValue and serialized to a string while retaining the order of map keys in the input.

Implementations§

source§

impl JValue

source

pub fn string(s: impl Into<Rc<str>>) -> JValue

source

pub fn array(vec: impl Into<Rc<[JValue]>>) -> JValue

source

pub fn array_from_iter( into_iter: impl IntoIterator<Item = impl Into<JValue>>, ) -> JValue

source

pub fn object(map: impl Into<BTreeMap<Rc<str>, JValue>>) -> JValue

source

pub fn object_from_pairs( into_iter: impl IntoIterator<Item = (impl Into<Rc<str>>, impl Into<JValue>)>, ) -> JValue

source

pub fn get<I>(&self, index: I) -> Option<&JValue>
where I: Index,

Index into a JSON array or map. A string index can be used to access a value in a map, and a usize index can be used to access an element of an array.

Returns None if the type of self does not match the type of the index, for example if the index is a string and self is an array or a number. Also returns None if the given key does not exist in the map or the given index is not within the bounds of the array.

Square brackets can also be used to index into a value in a more concise way. This returns JValue::Null in cases where get would have returned None.

source

pub fn is_object(&self) -> bool

Returns true if the JValue is an Object. Returns false otherwise.

For any JValue on which is_object returns true, as_object and as_object_mut are guaranteed to return the map representation of the object.

source

pub fn as_object(&self) -> Option<&BTreeMap<Rc<str>, JValue>>

If the JValue is an Object, returns the associated Map. Returns None otherwise.

source

pub fn is_array(&self) -> bool

Returns true if the JValue is an Array. Returns false otherwise.

For any JValue on which is_array returns true, as_array and as_array_mut are guaranteed to return the vector representing the array.

source

pub fn as_array(&self) -> Option<&[JValue]>

If the JValue is an Array, returns the associated vector. Returns None otherwise.

source

pub fn is_string(&self) -> bool

Returns true if the JValue is a String. Returns false otherwise.

For any JValue on which is_string returns true, as_str is guaranteed to return the string slice.

source

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

If the JValue is a string, returns the associated str. Returns None otherwise.

source

pub fn is_number(&self) -> bool

Returns true if the JValue is a Number. Returns false otherwise.

source

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

If the JValue is a Number, returns the associated Number. Returns None otherwise.

source

pub fn is_i64(&self) -> bool

Returns true if the JValue is an integer between i64::MIN and i64::MAX.

For any JValue on which is_i64 returns true, as_i64 is guaranteed to return the integer value.

source

pub fn is_u64(&self) -> bool

Returns true if the JValue is an integer between zero and u64::MAX.

For any JValue on which is_u64 returns true, as_u64 is guaranteed to return the integer value.

source

pub fn is_f64(&self) -> bool

Returns true if the JValue is a number that can be represented by f64.

For any JValue on which is_f64 returns true, as_f64 is guaranteed to return the floating point value.

Currently this function returns true if and only if both is_i64 and is_u64 return false but this is not a guarantee in the future.

source

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

If the JValue is an integer, represent it as i64 if possible. Returns None otherwise.

source

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

If the JValue is an integer, represent it as u64 if possible. Returns None otherwise.

source

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

If the JValue is a number, represent it as f64 if possible. Returns None otherwise.

source

pub fn is_boolean(&self) -> bool

Returns true if the JValue is a Boolean. Returns false otherwise.

For any JValue on which is_boolean returns true, as_bool is guaranteed to return the boolean value.

source

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

If the JValue is a Boolean, returns the associated bool. Returns None otherwise.

source

pub fn is_null(&self) -> bool

Returns true if the JValue is a Null. Returns false otherwise.

For any JValue on which is_null returns true, as_null is guaranteed to return Some(()).

source

pub fn as_null(&self) -> Option<()>

If the JValue is a Null, returns (). Returns None otherwise.

source

pub fn pointer(&self, pointer: &str) -> Option<&JValue>

Looks up a value by a JSON Pointer.

JSON Pointer defines a string syntax for identifying a specific value within a JavaScript Object Notation (JSON) document.

A Pointer is a Unicode string with the reference tokens separated by /. Inside tokens / is replaced by ~1 and ~ is replaced by ~0. The addressed value is returned and if there is no such value None is returned.

For more information read RFC6901.

source

pub fn take(&mut self) -> JValue

Takes the value out of the JValue, leaving a Null in its place.

Trait Implementations§

source§

impl Clone for JValue

source§

fn clone(&self) -> JValue

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 JValue

source§

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

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

impl Default for JValue

The default value is JValue::Null.

source§

fn default() -> JValue

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

impl<'de> Deserialize<'de> for JValue

source§

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

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

impl Display for JValue

source§

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

Display a JSON value as a string.

source§

impl<T> From<&[T]> for JValue
where T: Clone + Into<JValue>,

source§

fn from(f: &[T]) -> JValue

Convert a slice to JValue::Array.

§Examples
use air_interpreter_value::JValue;

let v: &[&str] = &["lorem", "ipsum", "dolor"];
let x: JValue = v.into();
source§

impl From<&Number> for JValue

source§

fn from(number: &Number) -> JValue

Converts to this type from the input type.
source§

impl From<&Value> for JValue

source§

fn from(value: &Value) -> JValue

Converts to this type from the input type.
source§

impl From<&str> for JValue

source§

fn from(f: &str) -> JValue

Convert string slice to JValue::String.

§Examples
use air_interpreter_value::JValue;

let s: &str = "lorem";
let x: JValue = s.into();
source§

impl From<()> for JValue

source§

fn from(_: ()) -> JValue

Convert () to JValue::Null.

§Examples
use air_interpreter_value::JValue;

let u = ();
let x: JValue = u.into();
source§

impl From<BTreeMap<Rc<str>, JValue>> for JValue

source§

fn from(f: BTreeMap<Rc<str>, JValue>) -> JValue

Convert map (with string keys) to JValue::Object.

§Examples
use air_interpreter_value::{Map, JValue, JsonString};

let mut m = Map::<JsonString, JValue>::new();
m.insert("Lorem".into(), "ipsum".into());
let x: JValue = m.into();
source§

impl<'a> From<Cow<'a, str>> for JValue

source§

fn from(f: Cow<'a, str>) -> JValue

Convert copy-on-write string to JValue::String.

§Examples
use air_interpreter_value::JValue;
use std::borrow::Cow;

let s: Cow<str> = Cow::Borrowed("lorem");
let x: JValue = s.into();
use air_interpreter_value::JValue;
use std::borrow::Cow;

let s: Cow<str> = Cow::Owned("lorem".to_string());
let x: JValue = s.into();
source§

impl<K, V> From<HashMap<K, V>> for JValue
where K: Into<Rc<str>>, V: Into<JValue>,

source§

fn from(f: HashMap<K, V>) -> JValue

Convert map (with string keys) to JValue::Object.

§Examples
use air_interpreter_value::JValue;
use std::collections::HashMap;

let mut m = HashMap::<&str, &str>::new();
m.insert("Lorem", "ipsum");
let x: JValue = m.into();
source§

impl From<JValue> for RawValue

source§

fn from(value: JValue) -> RawValue

Converts to this type from the input type.
source§

impl From<Number> for JValue

source§

fn from(f: Number) -> JValue

Convert serde_json::Number to JValue::Number.

§Examples
use serde_json::Number;
use air_interpreter_value::JValue;

let n = Number::from(7);
let x: JValue = n.into();
source§

impl<T> From<Option<T>> for JValue
where T: Into<JValue>,

source§

fn from(opt: Option<T>) -> JValue

Converts to this type from the input type.
source§

impl From<Rc<str>> for JValue

source§

fn from(f: Rc<str>) -> JValue

Convert JsonString to JValue::String.

§Examples
use air_interpreter_value::JValue;

let s: String = "lorem".to_string();
let x: JValue = s.into();
§

impl From<StreamMapKey> for JValue

§

fn from(value: StreamMapKey) -> JValue

Converts to this type from the input type.
source§

impl From<String> for JValue

source§

fn from(f: String) -> JValue

Convert String to JValue::String.

§Examples
use air_interpreter_value::JValue;

let s: String = "lorem".to_string();
let x: JValue = s.into();
source§

impl From<Value> for JValue

source§

fn from(value: Value) -> JValue

Converts to this type from the input type.
source§

impl<T> From<Vec<T>> for JValue
where T: Into<JValue>,

source§

fn from(f: Vec<T>) -> JValue

Convert a Vec to JValue::Array.

§Examples
use air_interpreter_value::JValue;

let v = vec!["lorem", "ipsum", "dolor"];
let x: JValue = v.into();
source§

impl From<bool> for JValue

source§

fn from(f: bool) -> JValue

Convert boolean to JValue::Bool.

§Examples
use air_interpreter_value::JValue;

let b = false;
let x: JValue = b.into();
source§

impl From<f32> for JValue

source§

fn from(f: f32) -> JValue

Convert 32-bit floating point number to JValue::Number, or JValue::Null if infinite or NaN.

§Examples
use air_interpreter_value::JValue;

let f: f32 = 13.37;
let x: JValue = f.into();
source§

impl From<f64> for JValue

source§

fn from(f: f64) -> JValue

Convert 64-bit floating point number to JValue::Number, or JValue::Null if infinite or NaN.

§Examples
use air_interpreter_value::JValue;

let f: f64 = 13.37;
let x: JValue = f.into();
source§

impl From<i16> for JValue

source§

fn from(n: i16) -> JValue

Converts to this type from the input type.
source§

impl From<i32> for JValue

source§

fn from(n: i32) -> JValue

Converts to this type from the input type.
source§

impl From<i64> for JValue

source§

fn from(n: i64) -> JValue

Converts to this type from the input type.
source§

impl From<i8> for JValue

source§

fn from(n: i8) -> JValue

Converts to this type from the input type.
source§

impl From<isize> for JValue

source§

fn from(n: isize) -> JValue

Converts to this type from the input type.
source§

impl From<u16> for JValue

source§

fn from(n: u16) -> JValue

Converts to this type from the input type.
source§

impl From<u32> for JValue

source§

fn from(n: u32) -> JValue

Converts to this type from the input type.
source§

impl From<u64> for JValue

source§

fn from(n: u64) -> JValue

Converts to this type from the input type.
source§

impl From<u8> for JValue

source§

fn from(n: u8) -> JValue

Converts to this type from the input type.
source§

impl From<usize> for JValue

source§

fn from(n: usize) -> JValue

Converts to this type from the input type.
source§

impl<K, V> FromIterator<(K, V)> for JValue
where K: Into<Rc<str>>, V: Into<JValue>,

source§

fn from_iter<I>(iter: I) -> JValue
where I: IntoIterator<Item = (K, V)>,

Create a JValue::Object by collecting an iterator of key-value pairs.

§Examples
use air_interpreter_value::JValue;

let v: Vec<_> = vec![("lorem", 40), ("ipsum", 2)];
let x: JValue = v.into_iter().collect();
source§

impl<T> FromIterator<T> for JValue
where T: Into<JValue>,

source§

fn from_iter<I>(iter: I) -> JValue
where I: IntoIterator<Item = T>,

Create a JValue::Array by collecting an iterator of array elements.

§Examples
use air_interpreter_value::JValue;

let v = std::iter::repeat(42).take(5);
let x: JValue = v.collect();
use air_interpreter_value::JValue;

let v: Vec<_> = vec!["lorem", "ipsum", "dolor"];
let x: JValue = v.into_iter().collect();
use std::iter::FromIterator;
use air_interpreter_value::JValue;

let x: JValue = JValue::from_iter(vec!["lorem", "ipsum", "dolor"]);
source§

impl<I> Index<I> for JValue
where I: Index,

source§

fn index(&self, index: I) -> &JValue

Index into a air_interpreter_value::JValue using the syntax value[0] or value["k"].

Returns JValue::Null if the type of self does not match the type of the index, for example if the index is a string and self is an array or a number. Also returns JValue::Null if the given key does not exist in the map or the given index is not within the bounds of the array.

For retrieving deeply nested values, you should have a look at the JValue::pointer method.

§

type Output = JValue

The returned type after indexing.
source§

impl PartialEq<&str> for JValue

source§

fn eq(&self, other: &&str) -> 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 PartialEq<JValue> for &str

source§

fn eq(&self, other: &JValue) -> 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 PartialEq<JValue> for str

source§

fn eq(&self, other: &JValue) -> 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 PartialEq<String> for JValue

source§

fn eq(&self, other: &String) -> 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<'a> PartialEq<bool> for &'a JValue

source§

fn eq(&self, other: &bool) -> 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 PartialEq<bool> for JValue

source§

fn eq(&self, other: &bool) -> 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<'a> PartialEq<f32> for &'a JValue

source§

fn eq(&self, other: &f32) -> 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 PartialEq<f32> for JValue

source§

fn eq(&self, other: &f32) -> 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<'a> PartialEq<f64> for &'a JValue

source§

fn eq(&self, other: &f64) -> 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 PartialEq<f64> for JValue

source§

fn eq(&self, other: &f64) -> 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<'a> PartialEq<i16> for &'a JValue

source§

fn eq(&self, other: &i16) -> 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 PartialEq<i16> for JValue

source§

fn eq(&self, other: &i16) -> 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<'a> PartialEq<i32> for &'a JValue

source§

fn eq(&self, other: &i32) -> 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 PartialEq<i32> for JValue

source§

fn eq(&self, other: &i32) -> 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<'a> PartialEq<i64> for &'a JValue

source§

fn eq(&self, other: &i64) -> 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 PartialEq<i64> for JValue

source§

fn eq(&self, other: &i64) -> 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<'a> PartialEq<i8> for &'a JValue

source§

fn eq(&self, other: &i8) -> 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 PartialEq<i8> for JValue

source§

fn eq(&self, other: &i8) -> 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<'a> PartialEq<isize> for &'a JValue

source§

fn eq(&self, other: &isize) -> 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 PartialEq<isize> for JValue

source§

fn eq(&self, other: &isize) -> 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 PartialEq<str> for JValue

source§

fn eq(&self, other: &str) -> 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<'a> PartialEq<u16> for &'a JValue

source§

fn eq(&self, other: &u16) -> 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 PartialEq<u16> for JValue

source§

fn eq(&self, other: &u16) -> 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<'a> PartialEq<u32> for &'a JValue

source§

fn eq(&self, other: &u32) -> 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 PartialEq<u32> for JValue

source§

fn eq(&self, other: &u32) -> 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<'a> PartialEq<u64> for &'a JValue

source§

fn eq(&self, other: &u64) -> 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 PartialEq<u64> for JValue

source§

fn eq(&self, other: &u64) -> 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<'a> PartialEq<u8> for &'a JValue

source§

fn eq(&self, other: &u8) -> 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 PartialEq<u8> for JValue

source§

fn eq(&self, other: &u8) -> 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<'a> PartialEq<usize> for &'a JValue

source§

fn eq(&self, other: &usize) -> 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 PartialEq<usize> for JValue

source§

fn eq(&self, other: &usize) -> 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 PartialEq for JValue

source§

fn eq(&self, other: &JValue) -> 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 JValue

source§

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

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

impl Eq for JValue

source§

impl StructuralPartialEq for JValue

Auto Trait Implementations§

§

impl Freeze for JValue

§

impl RefUnwindSafe for JValue

§

impl !Send for JValue

§

impl !Sync for JValue

§

impl Unpin for JValue

§

impl UnwindSafe for JValue

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
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

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

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
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.
§

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

§

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

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

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

§

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

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

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

§

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.

§

impl<T> GetSetFdFlags for T

§

fn get_fd_flags(&self) -> Result<FdFlags, Error>
where T: AsFilelike,

Query the “status” flags for the self file descriptor.
§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>
where T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>
where T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

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

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

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.

§

impl<T> LayoutRaw for T

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( pointer: <T as Pointee>::Pointer, f: &mut Formatter<'_>, ) -> Result<(), Error>

source§

impl<T> Same for T

§

type Output = T

Should always be Self
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> ToString for T
where 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 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.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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