Enum wasmer_vm::WeakOrStrongInstanceRef[][src]

pub enum WeakOrStrongInstanceRef {
    Weak(WeakInstanceRef),
    Strong(InstanceRef),
}
Expand description

An InstanceRef that may or may not be keeping the Instance alive.

This type is useful for types that conditionally must keep / not keep the underlying Instance alive. For example, to prevent cycles in WasmerEnvs.

Variants

Weak(WeakInstanceRef)

Tuple Fields

0: WeakInstanceRef

A weak instance ref.

Strong(InstanceRef)

Tuple Fields

0: InstanceRef

A strong instance ref.

Implementations

Tries to upgrade weak references to a strong reference, returning None if it can’t be done.

Clones self into a weak reference.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the size of the referenced value in bytes. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

The archived version of the pointer metadata for this type.

Converts some archived metadata to the pointer metadata for itself.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Deserializes using the given deserializer

Performs the conversion.

Performs the conversion.

The type for metadata in pointers and references to Self.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.