pub enum Value {
Nil,
Boolean(bool),
Integer(Integer),
F32(f32),
F64(f64),
String(Utf8String),
Binary(Vec<u8, Global>),
Array(Vec<Value, Global>),
Map(Vec<(Value, Value), Global>),
Ext(i8, Vec<u8, Global>),
}
Expand description
Represents any valid MessagePack value.
Variants
Nil
Nil represents nil.
Boolean(bool)
Boolean represents true or false.
Integer(Integer)
Integer represents an integer.
A value of an Integer
object is limited from -(2^63)
upto (2^64)-1
.
Examples
use rmpv::Value;
assert_eq!(42, Value::from(42).as_i64().unwrap());
F32(f32)
A 32-bit floating point number.
F64(f64)
A 64-bit floating point number.
String(Utf8String)
String extending Raw type represents a UTF-8 string.
Note
String objects may contain invalid byte sequence and the behavior of a deserializer depends on the actual implementation when it received invalid byte sequence. Deserializers should provide functionality to get the original byte array so that applications can decide how to handle the object
Binary(Vec<u8, Global>)
Binary extending Raw type represents a byte array.
Array(Vec<Value, Global>)
Array represents a sequence of objects.
Map(Vec<(Value, Value), Global>)
Map represents key-value pairs of objects.
Ext(i8, Vec<u8, Global>)
Extended implements Extension interface: represents a tuple of type information and a byte array where type information is an integer whose meaning is defined by applications.
Implementations
impl Value
impl Value
pub fn as_ref(&self) -> ValueRef<'_>
pub fn as_ref(&self) -> ValueRef<'_>
Converts the current owned Value to a ValueRef.
Panics
Panics in unable to allocate memory to keep all internal structures and buffers.
Examples
use rmpv::{Value, ValueRef};
let val = Value::Array(vec![
Value::Nil,
Value::from(42),
Value::Array(vec![
Value::String("le message".into())
])
]);
let expected = ValueRef::Array(vec![
ValueRef::Nil,
ValueRef::from(42),
ValueRef::Array(vec![
ValueRef::from("le message"),
])
]);
assert_eq!(expected, val.as_ref());
pub fn is_nil(&self) -> bool
pub fn is_nil(&self) -> bool
Returns true if the Value
is a Null. Returns false otherwise.
Examples
use rmpv::Value;
assert!(Value::Nil.is_nil());
pub fn is_bool(&self) -> bool
pub fn is_bool(&self) -> bool
Returns true if the Value
is a Boolean. Returns false otherwise.
Examples
use rmpv::Value;
assert!(Value::Boolean(true).is_bool());
assert!(!Value::Nil.is_bool());
pub fn is_i64(&self) -> bool
pub fn is_i64(&self) -> bool
Returns true if the Value
is convertible to an i64. Returns false otherwise.
Examples
use rmpv::Value;
assert!(Value::from(42).is_i64());
assert!(!Value::from(42.0).is_i64());
pub fn is_u64(&self) -> bool
pub fn is_u64(&self) -> bool
Returns true if the Value
is convertible to an u64. Returns false otherwise.
Examples
use rmpv::Value;
assert!(Value::from(42).is_u64());
assert!(!Value::F32(42.0).is_u64());
assert!(!Value::F64(42.0).is_u64());
pub fn is_f32(&self) -> bool
pub fn is_f32(&self) -> bool
Returns true if (and only if) the Value
is a f32. Returns false otherwise.
Examples
use rmpv::Value;
assert!(Value::F32(42.0).is_f32());
assert!(!Value::from(42).is_f32());
assert!(!Value::F64(42.0).is_f32());
pub fn is_f64(&self) -> bool
pub fn is_f64(&self) -> bool
Returns true if (and only if) the Value
is a f64. Returns false otherwise.
Examples
use rmpv::Value;
assert!(Value::F64(42.0).is_f64());
assert!(!Value::from(42).is_f64());
assert!(!Value::F32(42.0).is_f64());
pub fn is_number(&self) -> bool
pub fn is_number(&self) -> bool
Returns true if the Value
is a Number. Returns false otherwise.
Examples
use rmpv::Value;
assert!(Value::from(42).is_number());
assert!(Value::F32(42.0).is_number());
assert!(Value::F64(42.0).is_number());
assert!(!Value::Nil.is_number());
pub fn is_str(&self) -> bool
pub fn is_str(&self) -> bool
Returns true if the Value
is a String. Returns false otherwise.
Examples
use rmpv::Value;
assert!(Value::String("value".into()).is_str());
assert!(!Value::Nil.is_str());
pub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
If the Value
is a Boolean, returns the associated bool.
Returns None otherwise.
Examples
use rmpv::Value;
assert_eq!(Some(true), Value::Boolean(true).as_bool());
assert_eq!(None, Value::Nil.as_bool());
pub fn as_i64(&self) -> Option<i64>
pub fn as_i64(&self) -> Option<i64>
If the Value
is an integer, return or cast it to a i64.
Returns None otherwise.
Examples
use rmpv::Value;
assert_eq!(Some(42i64), Value::from(42).as_i64());
assert_eq!(None, Value::F64(42.0).as_i64());
pub fn as_u64(&self) -> Option<u64>
pub fn as_u64(&self) -> Option<u64>
If the Value
is an integer, return or cast it to a u64.
Returns None otherwise.
Examples
use rmpv::Value;
assert_eq!(Some(42u64), Value::from(42).as_u64());
assert_eq!(None, Value::from(-42).as_u64());
assert_eq!(None, Value::F64(42.0).as_u64());
pub fn as_f64(&self) -> Option<f64>
pub fn as_f64(&self) -> Option<f64>
If the Value
is a number, return or cast it to a f64.
Returns None otherwise.
Examples
use rmpv::Value;
assert_eq!(Some(42.0), Value::from(42).as_f64());
assert_eq!(Some(42.0), Value::F32(42.0f32).as_f64());
assert_eq!(Some(42.0), Value::F64(42.0f64).as_f64());
assert_eq!(Some(2147483647.0), Value::from(i32::max_value() as i64).as_f64());
assert_eq!(None, Value::Nil.as_f64());
pub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
If the Value
is a String, returns the associated str.
Returns None otherwise.
Examples
use rmpv::Value;
assert_eq!(Some("le message"), Value::String("le message".into()).as_str());
assert_eq!(None, Value::Boolean(true).as_str());
pub fn as_slice(&self) -> Option<&[u8]>
pub fn as_slice(&self) -> Option<&[u8]>
If the Value
is a Binary or a String, returns the associated slice.
Returns None otherwise.
Examples
use rmpv::Value;
assert_eq!(Some(&[1, 2, 3, 4, 5][..]), Value::Binary(vec![1, 2, 3, 4, 5]).as_slice());
assert_eq!(None, Value::Boolean(true).as_slice());
pub fn as_array(&self) -> Option<&Vec<Value, Global>>
pub fn as_array(&self) -> Option<&Vec<Value, Global>>
If the Value
is an Array, returns the associated vector.
Returns None otherwise.
Examples
use rmpv::Value;
let val = Value::Array(vec![Value::Nil, Value::Boolean(true)]);
assert_eq!(Some(&vec![Value::Nil, Value::Boolean(true)]), val.as_array());
assert_eq!(None, Value::Nil.as_array());
pub fn as_map(&self) -> Option<&Vec<(Value, Value), Global>>
pub fn as_map(&self) -> Option<&Vec<(Value, Value), Global>>
If the Value
is a Map, returns the associated vector of key-value tuples.
Returns None otherwise.
Note
MessagePack represents map as a vector of key-value tuples.
Examples
use rmpv::Value;
let val = Value::Map(vec![(Value::Nil, Value::Boolean(true))]);
assert_eq!(Some(&vec![(Value::Nil, Value::Boolean(true))]), val.as_map());
assert_eq!(None, Value::Nil.as_map());
pub fn as_ext(&self) -> Option<(i8, &[u8])>
pub fn as_ext(&self) -> Option<(i8, &[u8])>
If the Value
is an Ext, returns the associated tuple with a ty and slice.
Returns None otherwise.
Examples
use rmpv::Value;
assert_eq!(Some((42, &[1, 2, 3, 4, 5][..])), Value::Ext(42, vec![1, 2, 3, 4, 5]).as_ext());
assert_eq!(None, Value::Boolean(true).as_ext());
Trait Implementations
impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
fn deserialize<D>(de: D) -> Result<Value, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
fn deserialize<D>(de: D) -> Result<Value, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<'de> Deserializer<'de> for Value
impl<'de> Deserializer<'de> for Value
type Error = Error
type Error = Error
The error type that can be returned if some error occurs during deserialization. Read more
fn deserialize_any<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_any<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Require the Deserializer
to figure out how to drive the visitor based
on what data type is in the input. Read more
fn deserialize_option<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_option<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an optional value. Read more
fn deserialize_enum<V>(
self,
_name: &str,
_variants: &'static [&'static str],
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_enum<V>(
self,
_name: &str,
_variants: &'static [&'static str],
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an enum value with a
particular name and possible variants. Read more
fn deserialize_newtype_struct<V>(
self,
name: &'static str,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_newtype_struct<V>(
self,
name: &'static str,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a newtype struct with a
particular name. Read more
fn deserialize_unit_struct<V>(
self,
_name: &'static str,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_unit_struct<V>(
self,
_name: &'static str,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a unit struct with a
particular name. Read more
fn deserialize_bool<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_bool<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a bool
value.
fn deserialize_u8<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_u8<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a u8
value.
fn deserialize_u16<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_u16<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a u16
value.
fn deserialize_u32<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_u32<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a u32
value.
fn deserialize_u64<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_u64<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a u64
value.
fn deserialize_i8<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_i8<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an i8
value.
fn deserialize_i16<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_i16<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an i16
value.
fn deserialize_i32<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_i32<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an i32
value.
fn deserialize_i64<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_i64<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an i64
value.
fn deserialize_f32<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_f32<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a f32
value.
fn deserialize_f64<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_f64<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a f64
value.
fn deserialize_char<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_char<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a char
value.
fn deserialize_str<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_str<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a string value and does
not benefit from taking ownership of buffered data owned by the
Deserializer
. Read more
fn deserialize_string<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_string<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a string value and would
benefit from taking ownership of buffered data owned by the
Deserializer
. Read more
fn deserialize_unit<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_unit<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a unit value.
fn deserialize_seq<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_seq<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a sequence of values.
fn deserialize_bytes<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_bytes<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a byte array and does not
benefit from taking ownership of buffered data owned by the
Deserializer
. Read more
fn deserialize_byte_buf<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_byte_buf<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a byte array and would
benefit from taking ownership of buffered data owned by the
Deserializer
. Read more
fn deserialize_map<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_map<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a map of key-value pairs.
fn deserialize_tuple_struct<V>(
self,
name: &'static str,
len: usize,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_tuple_struct<V>(
self,
name: &'static str,
len: usize,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a tuple struct with a
particular name and number of fields. Read more
fn deserialize_struct<V>(
self,
name: &'static str,
fields: &'static [&'static str],
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_struct<V>(
self,
name: &'static str,
fields: &'static [&'static str],
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a struct with a particular
name and fields. Read more
fn deserialize_identifier<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_identifier<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting the name of a struct
field or the discriminant of an enum variant. Read more
fn deserialize_tuple<V>(
self,
len: usize,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_tuple<V>(
self,
len: usize,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a sequence of values and
knows how many values there are without looking at the serialized data. Read more
fn deserialize_ignored_any<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
fn deserialize_ignored_any<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type needs to deserialize a value whose type
doesn’t matter because it is ignored. Read more
sourcefn deserialize_i128<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_i128<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an i128
value. Read more
sourcefn deserialize_u128<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_u128<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an u128
value. Read more
sourcefn is_human_readable(&self) -> bool
fn is_human_readable(&self) -> bool
Determine whether Deserialize
implementations should expect to
deserialize their human-readable form. Read more
impl<V> FromIterator<V> for Value where
V: Into<Value>,
impl<V> FromIterator<V> for Value where
V: Into<Value>,
fn from_iter<I>(iter: I) -> Value where
I: IntoIterator<Item = V>,
fn from_iter<I>(iter: I) -> Value where
I: IntoIterator<Item = V>,
Creates a value from an iterator. Read more
impl Serialize for Value
impl Serialize for Value
fn serialize<S>(
&self,
s: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
fn serialize<S>(
&self,
s: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl TryFrom<Value> for Utf8String
impl TryFrom<Value> for Utf8String
fn try_from(
val: Value
) -> Result<Utf8String, <Utf8String as TryFrom<Value>>::Error>
fn try_from(
val: Value
) -> Result<Utf8String, <Utf8String as TryFrom<Value>>::Error>
Performs the conversion.
impl StructuralPartialEq for Value
Auto Trait Implementations
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more