pub struct Value<T = ()> {
pub value: ValueDef<T>,
pub context: T,
}
Expand description
Value
holds a representation of some value that has been decoded, as well as some arbitrary context.
Not all SCALE encoded types have an similar-named value; for instance, the values corresponding to
sequence, array and composite types can all be represented with [Composite
]. Only enough information
is preserved here to to be able to encode and decode SCALE bytes with a known type to and from Value
s
losslessly.
Fields§
§value: ValueDef<T>
The shape and associated data for this Value
context: T
Some additional arbitrary context that can be associated with a value.
Implementations§
§impl Value
impl Value
pub fn named_composite<S, Vals>(vals: Vals) -> Value
pub fn named_composite<S, Vals>(vals: Vals) -> Value
Construct a named composite type from any type which produces a tuple of keys and values when iterated over.
pub fn unnamed_composite<Vals>(vals: Vals) -> Valuewhere
Vals: IntoIterator<Item = Value>,
pub fn unnamed_composite<Vals>(vals: Vals) -> Valuewhere
Vals: IntoIterator<Item = Value>,
Construct an unnamed composite type from any type which produces values when iterated over.
pub fn variant<S>(name: S, values: Composite<()>) -> Value
pub fn variant<S>(name: S, values: Composite<()>) -> Value
Create a new variant value without additional context.
pub fn named_variant<S, F, Vals>(name: S, fields: Vals) -> Value
pub fn named_variant<S, F, Vals>(name: S, fields: Vals) -> Value
Create a new variant value with named fields and without additional context.
pub fn unnamed_variant<S, Vals>(name: S, fields: Vals) -> Value
pub fn unnamed_variant<S, Vals>(name: S, fields: Vals) -> Value
Create a new variant value with tuple-like fields and without additional context.
pub fn bit_sequence(bits: Bits) -> Value
pub fn bit_sequence(bits: Bits) -> Value
Create a new bit sequence value without additional context.
pub fn primitive(primitive: Primitive) -> Value
pub fn primitive(primitive: Primitive) -> Value
Create a new primitive value without additional context.
pub fn from_bytes(bytes: impl AsRef<[u8]>) -> Value
pub fn from_bytes(bytes: impl AsRef<[u8]>) -> Value
Create a new Value from a set of bytes; useful for converting things like AccountIds.
§impl Value
impl Value
pub fn without_context(value: ValueDef<()>) -> Value
pub fn without_context(value: ValueDef<()>) -> Value
Create a new value with no associated context.
§impl<T> Value<T>
impl<T> Value<T>
pub fn with_context(value: ValueDef<T>, context: T) -> Value<T>
pub fn with_context(value: ValueDef<T>, context: T) -> Value<T>
Create a new value with some associated context.
pub fn remove_context(self) -> Value
pub fn remove_context(self) -> Value
Remove the context.
pub fn map_context<F, U>(self, f: F) -> Value<U>
pub fn map_context<F, U>(self, f: F) -> Value<U>
Map the context to some different type.
Trait Implementations§
§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
§fn deserialize<D>(
deserializer: D,
) -> Result<Value, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Value, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl<'de, T> Deserializer<'de> for Value<T>
impl<'de, T> Deserializer<'de> for Value<T>
§type Error = DeserializerError
type Error = DeserializerError
§fn deserialize_any<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_any<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserializer
to figure out how to drive the visitor based
on what data type is in the input. Read more§fn deserialize_bool<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_bool<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting a bool
value.§fn deserialize_i8<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_i8<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting an i8
value.§fn deserialize_i16<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_i16<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting an i16
value.§fn deserialize_i32<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_i32<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting an i32
value.§fn deserialize_i64<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_i64<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting an i64
value.§fn deserialize_i128<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_i128<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
§fn deserialize_u8<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_u8<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting a u8
value.§fn deserialize_u16<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_u16<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting a u16
value.§fn deserialize_u32<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_u32<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting a u32
value.§fn deserialize_u64<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_u64<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting a u64
value.§fn deserialize_u128<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_u128<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
§fn deserialize_f32<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_f32<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting a f32
value.§fn deserialize_f64<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_f64<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting a f64
value.§fn deserialize_char<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_char<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting a char
value.§fn deserialize_str<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_str<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
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<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_string<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting a string value and would
benefit from taking ownership of buffered data owned by the
Deserializer
. Read more§fn deserialize_bytes<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_bytes<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
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<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_byte_buf<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting a byte array and would
benefit from taking ownership of buffered data owned by the
Deserializer
. Read more§fn deserialize_option<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_option<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting an optional value. Read more§fn deserialize_unit<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_unit<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting a unit value.§fn deserialize_seq<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_seq<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting a sequence of values.§fn deserialize_map<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_map<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting a map of key-value pairs.§fn deserialize_identifier<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_identifier<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting the name of a struct
field or the discriminant of an enum variant.§fn deserialize_ignored_any<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_ignored_any<V>(
self,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type needs to deserialize a value whose type
doesn’t matter because it is ignored. Read more§fn deserialize_unit_struct<V>(
self,
name: &'static str,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> 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<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting a unit struct with a
particular name.§fn deserialize_newtype_struct<V>(
self,
name: &'static str,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> 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<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting a newtype struct with a
particular name.§fn deserialize_tuple<V>(
self,
len: usize,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_tuple<V>(
self,
len: usize,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting a sequence of values and
knows how many values there are without looking at the serialized data.§fn deserialize_tuple_struct<V>(
self,
name: &'static str,
len: usize,
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> 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<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting a tuple struct with a
particular name and number of fields.§fn deserialize_struct<V>(
self,
name: &'static str,
fields: &'static [&'static str],
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> 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<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting a struct with a particular
name and fields.§fn deserialize_enum<V>(
self,
name: &'static str,
variants: &'static [&'static str],
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
fn deserialize_enum<V>(
self,
name: &'static str,
variants: &'static [&'static str],
visitor: V,
) -> Result<<V as Visitor<'de>>::Value, <Value<T> as Deserializer<'de>>::Error>where
V: Visitor<'de>,
Deserialize
type is expecting an enum value with a
particular name and possible variants.source§fn is_human_readable(&self) -> bool
fn is_human_readable(&self) -> bool
Deserialize
implementations should expect to
deserialize their human-readable form. Read more§impl<T> EncodeAsFields for Value<T>
impl<T> EncodeAsFields for Value<T>
§fn encode_as_fields_to<R>(
&self,
fields: &mut dyn FieldIter<'_, <R as TypeResolver>::TypeId, Item = Field<'_, <R as TypeResolver>::TypeId>>,
types: &R,
out: &mut Vec<u8>,
) -> Result<(), Error>where
R: TypeResolver,
fn encode_as_fields_to<R>(
&self,
fields: &mut dyn FieldIter<'_, <R as TypeResolver>::TypeId, Item = Field<'_, <R as TypeResolver>::TypeId>>,
types: &R,
out: &mut Vec<u8>,
) -> Result<(), Error>where
R: TypeResolver,
§fn encode_as_fields<R>(
&self,
fields: &mut dyn FieldIter<'_, <R as TypeResolver>::TypeId, Item = Field<'_, <R as TypeResolver>::TypeId>>,
types: &R,
) -> Result<Vec<u8>, Error>where
R: TypeResolver,
fn encode_as_fields<R>(
&self,
fields: &mut dyn FieldIter<'_, <R as TypeResolver>::TypeId, Item = Field<'_, <R as TypeResolver>::TypeId>>,
types: &R,
) -> Result<Vec<u8>, Error>where
R: TypeResolver,
EncodeAsFields::encode_as_fields_to
]. Prefer to
implement that instead.§impl<T> EncodeAsType for Value<T>
impl<T> EncodeAsType for Value<T>
§fn encode_as_type_to<R>(
&self,
type_id: <R as TypeResolver>::TypeId,
types: &R,
out: &mut Vec<u8>,
) -> Result<(), Error>where
R: TypeResolver,
fn encode_as_type_to<R>(
&self,
type_id: <R as TypeResolver>::TypeId,
types: &R,
out: &mut Vec<u8>,
) -> Result<(), Error>where
R: TypeResolver,
type_id
, types
, a context
and some output target for the SCALE encoded bytes,
attempt to SCALE encode the current value into the type given by type_id
.source§impl From<RuntimeCall> for Value
impl From<RuntimeCall> for Value
source§fn from(call: RuntimeCall) -> Value
fn from(call: RuntimeCall) -> Value
§impl<'de, T> IntoDeserializer<'de, DeserializerError> for Value<T>
impl<'de, T> IntoDeserializer<'de, DeserializerError> for Value<T>
§type Deserializer = Value<T>
type Deserializer = Value<T>
§fn into_deserializer(
self,
) -> <Value<T> as IntoDeserializer<'de, DeserializerError>>::Deserializer
fn into_deserializer( self, ) -> <Value<T> as IntoDeserializer<'de, DeserializerError>>::Deserializer
§impl IntoVisitor for Value
impl IntoVisitor for Value
§type AnyVisitor<R: TypeResolver> = VisitorWithCrateError<DecodeValueVisitor<R, EmptyContext>>
type AnyVisitor<R: TypeResolver> = VisitorWithCrateError<DecodeValueVisitor<R, EmptyContext>>
Self
.§fn into_visitor<R>() -> <Value as IntoVisitor>::AnyVisitor<R>where
R: TypeResolver,
fn into_visitor<R>() -> <Value as IntoVisitor>::AnyVisitor<R>where
R: TypeResolver,
§impl<T> Serialize for Value<T>
impl<T> Serialize for Value<T>
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl<T> Eq for Value<T>where
T: Eq,
impl<T> StructuralPartialEq for Value<T>
Auto Trait Implementations§
impl<T> Freeze for Value<T>where
T: Freeze,
impl<T> RefUnwindSafe for Value<T>where
T: RefUnwindSafe,
impl<T> Send for Value<T>where
T: Send,
impl<T> Sync for Value<T>where
T: Sync,
impl<T> Unpin for Value<T>where
T: Unpin,
impl<T> UnwindSafe for Value<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Conv for T
impl<T> Conv for T
§impl<T> DecodeAsType for Twhere
T: IntoVisitor,
impl<T> DecodeAsType for Twhere
T: IntoVisitor,
fn decode_as_type_maybe_compact<R>(
input: &mut &[u8],
type_id: <R as TypeResolver>::TypeId,
types: &R,
is_compact: bool,
) -> Result<T, Error>where
R: TypeResolver,
§fn decode_as_type<R>(
input: &mut &[u8],
type_id: <R as TypeResolver>::TypeId,
types: &R,
) -> Result<Self, Error>where
R: TypeResolver,
fn decode_as_type<R>(
input: &mut &[u8],
type_id: <R as TypeResolver>::TypeId,
types: &R,
) -> Result<Self, Error>where
R: TypeResolver,
type_id
, and type registry, attempt to decode said bytes into
Self
. Implementations should modify the &mut
reference to the bytes such that any bytes
not used in the course of decoding are still pointed to after decoding is complete.§impl<T> DecodeWithMetadata for Twhere
T: DecodeAsType,
impl<T> DecodeWithMetadata for Twhere
T: DecodeAsType,
§fn decode_with_metadata(
bytes: &mut &[u8],
type_id: u32,
metadata: &Metadata,
) -> Result<T, Error>
fn decode_with_metadata( bytes: &mut &[u8], type_id: u32, metadata: &Metadata, ) -> Result<T, Error>
Self
.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> EncodeWithMetadata for Twhere
T: EncodeAsType,
impl<T> EncodeWithMetadata for Twhere
T: EncodeAsType,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read more§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.§impl<T> TryConv for T
impl<T> TryConv for T
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.