pub struct AnyT { /* private fields */ }Expand description
Generic type that accepts any Move type argument in its slot,
including phantom-paramed generics such as VENDOR<X> as well as
non-struct types (primitives, vectors).
Where crate::otw::Otw requires n_types_expected == 0 and therefore
rejects phantom-paramed arguments, AnyT performs no validation — its
associated AnyTTypeTag simply captures the raw TypeTag so it
can be read back unchanged.
AnyT is intended for phantom slots only in generic Move types
(e.g. AuthorityCap<AnyT, AnyT>). It is never instantiated as a real
value; its MoveType impl exists so the derive-generated parsers can
thread phantom-paramed type arguments through unchanged.
Note: AnyT deliberately does not implement MoveStruct —
MoveStructTag: TryFrom<StructTag> is incompatible with carrying an
arbitrary TypeTag (which may be non-struct). Use crate::otw::Otw
when you need a MoveStruct-bounded slot type.
Unlike Otw, AnyT does not implement crate::StaticTypeTag or
its Static* siblings: it has no statically known type tag, by design.
Use it on the runtime decode path (e.g.
MoveInstance::from_raw_type).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AnyT
impl<'de> Deserialize<'de> for AnyT
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl MoveType for AnyT
impl MoveType for AnyT
impl Eq for AnyT
impl StructuralPartialEq for AnyT
Auto Trait Implementations§
impl Freeze for AnyT
impl RefUnwindSafe for AnyT
impl Send for AnyT
impl Sync for AnyT
impl Unpin for AnyT
impl UnsafeUnpin for AnyT
impl UnwindSafe for AnyT
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'de, T> FromBcs for Twhere
T: Deserialize<'de>,
impl<'de, T> FromBcs for Twhere
T: Deserialize<'de>,
fn from_bcs<'de>(bytes: &'de [u8]) -> Result<Self, Error>where
Self: Deserialize<'de>,
fn from_bcs_base64(base64: &str) -> Result<Self, Error>where
Self: DeserializeOwned,
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