Skip to main content

ExportItem

Enum ExportItem 

Source
pub enum ExportItem<T> {
    Index(T),
    Name(TryString),
}
Expand description

An index at which to find an item within a runtime instance.

Variants§

§

Index(T)

An exact index that the target can be found at.

This is used where possible to avoid name lookups at runtime during the instantiation process. This can only be used on instances where the module was statically known at compile time, however.

§

Name(TryString)

An item which is identified by a name, so at runtime we need to perform a name lookup to determine the index that the item is located at.

This is used for instantiations of imported modules, for example, since the precise shape of the module is not known.

Trait Implementations§

Source§

impl<T: Debug> Debug for ExportItem<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, T> Deserialize<'de> for ExportItem<T>
where T: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T: Eq> Eq for ExportItem<T>

Source§

impl<T: Hash> Hash for ExportItem<T>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T: PartialEq> PartialEq for ExportItem<T>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T> Serialize for ExportItem<T>
where T: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T: PartialEq> StructuralPartialEq for ExportItem<T>

Source§

impl<T: TryClone> TryClone for ExportItem<T>

Source§

fn try_clone(&self) -> Result<Self, OutOfMemory>

Attempt to clone self, returning an error if any allocation fails during cloning.
§

fn clone_panic_on_oom(&self) -> Self

Clone self, panicking on allocation failure.

Auto Trait Implementations§

§

impl<T> Freeze for ExportItem<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for ExportItem<T>
where T: RefUnwindSafe,

§

impl<T> Send for ExportItem<T>
where T: Send,

§

impl<T> Sync for ExportItem<T>
where T: Sync,

§

impl<T> Unpin for ExportItem<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for ExportItem<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for ExportItem<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> TryToOwned for T
where T: TryClone,

§

type Owned = T

The owned version of this type.
§

fn try_to_owned(&self) -> Result<<T as TryToOwned>::Owned, OutOfMemory>

Try to allocate an owned version of self.