pub struct TypeDescriptor(/* private fields */);Expand description
An owned contract type descriptor with an invariant-preserving private representation.
Implementations§
Source§impl TypeDescriptor
impl TypeDescriptor
Sourcepub fn view(&self) -> DescriptorRef<'_>
pub fn view(&self) -> DescriptorRef<'_>
Borrows this descriptor through its complete read-only view.
Source§impl TypeDescriptor
impl TypeDescriptor
Sourcepub fn secret(inner: Self) -> Result<Self, DescriptorError>
pub fn secret(inner: Self) -> Result<Self, DescriptorError>
Constructs a sensitive value descriptor.
Sourcepub fn optional(inner: Self) -> Result<Self, DescriptorError>
pub fn optional(inner: Self) -> Result<Self, DescriptorError>
Constructs an optional descriptor.
Sourcepub fn tri_state(inner: Self) -> Result<Self, DescriptorError>
pub fn tri_state(inner: Self) -> Result<Self, DescriptorError>
Constructs a tri-state descriptor.
Sourcepub fn list(inner: Self) -> Result<Self, DescriptorError>
pub fn list(inner: Self) -> Result<Self, DescriptorError>
Constructs a list descriptor.
Sourcepub fn map(inner: Self) -> Result<Self, DescriptorError>
pub fn map(inner: Self) -> Result<Self, DescriptorError>
Constructs a string-keyed map descriptor.
Sourcepub fn structure(
fields: impl IntoIterator<Item = FieldDescriptor>,
) -> Result<Self, DescriptorError>
pub fn structure( fields: impl IntoIterator<Item = FieldDescriptor>, ) -> Result<Self, DescriptorError>
Constructs an ordered struct descriptor with unique field names.
Sourcepub fn enumeration(
variants: impl IntoIterator<Item = VariantDescriptor>,
) -> Result<Self, DescriptorError>
pub fn enumeration( variants: impl IntoIterator<Item = VariantDescriptor>, ) -> Result<Self, DescriptorError>
Constructs an ordered enum descriptor with unique variant tags.
Sourcepub fn conform(
&self,
role: DecodeRole,
slot: SlotValue,
) -> Result<SlotValue, ConformanceError>
pub fn conform( &self, role: DecodeRole, slot: SlotValue, ) -> Result<SlotValue, ConformanceError>
Conforms a call slot to this descriptor for the selected decoding role.
Trait Implementations§
Source§impl Clone for TypeDescriptor
impl Clone for TypeDescriptor
Source§fn clone(&self) -> TypeDescriptor
fn clone(&self) -> TypeDescriptor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TypeDescriptor
impl Debug for TypeDescriptor
impl Eq for TypeDescriptor
Source§impl PartialEq for TypeDescriptor
impl PartialEq for TypeDescriptor
impl StructuralPartialEq for TypeDescriptor
Auto Trait Implementations§
impl Freeze for TypeDescriptor
impl RefUnwindSafe for TypeDescriptor
impl Send for TypeDescriptor
impl Sync for TypeDescriptor
impl Unpin for TypeDescriptor
impl UnsafeUnpin for TypeDescriptor
impl UnwindSafe for TypeDescriptor
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
Mutably borrows from an owned value. Read more