[][src]Struct solana_libra_vm::file_format::StructHandle

pub struct StructHandle {
    pub module: ModuleHandleIndex,
    pub name: IdentifierIndex,
    pub is_nominal_resource: bool,
    pub type_formals: Vec<Kind>,
}

A StructHandle is a reference to a user defined type. It is composed by a ModuleHandle and the name of the type within that module.

A type in a module is uniquely identified by its name and as such the name is enough to perform resolution.

The StructHandle is polymorphic: it can have type parameters in its fields and carries the kind constraints for these type parameters (empty list for non-generic structs). It also carries the kind (resource/copyable) of the struct itself so that the verifier can check resource semantic without having to load the referenced type.

At link time kind checking is performed and an error is reported if there is a mismatch with the definition.

Fields

module: ModuleHandleIndex

The module that defines the type.

name: IdentifierIndex

The name of the type.

is_nominal_resource: bool

There are two ways for a type to have the Kind resource

  1. If it has a type argument of resource
  2. If it was declared as a resource These "declared" resources are referred to as nominal resources

If is_nominal_resource is true, it is a nominal resource

type_formals: Vec<Kind>

The type formals (identified by their index into the vec) and their kind constraints

Trait Implementations

impl<'_> BoundsCheck<&'_ CompiledModuleMut> for StructHandle[src]

impl Clone for StructHandle[src]

impl Debug for StructHandle[src]

impl Eq for StructHandle[src]

impl Hash for StructHandle[src]

impl Ord for StructHandle[src]

impl PartialEq<StructHandle> for StructHandle[src]

impl PartialOrd<StructHandle> for StructHandle[src]

impl StructuralEq for StructHandle[src]

impl StructuralPartialEq for StructHandle[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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