Type Alias gluon_vm::api::Generic

source ·
pub type Generic<T> = OpaqueValue<RootedThread, T>;

Aliased Type§

struct Generic<T>(/* private fields */);

Implementations§

source§

impl<T, V> Opaque<RootedValue<T>, V>where T: VmRootInternal, V: ?Sized,

source

pub fn vm(&self) -> &Thread

source

pub fn to_value<'vm>(&'vm self) -> Vwhere V: Getable<'vm, 'vm>,

Converts the value into its Rust representation

source§

impl<T, V> Opaque<T, V>where V: ?Sized,

source

pub fn from_value(value: T) -> Self

source

pub fn into_inner(self) -> T

source§

impl<'s, 'value, T, V> Opaque<T, V>where T: AsVariant<'s, 'value>, V: ?Sized,

source

pub fn get_value(&'s self) -> &'s Value

source

pub fn get_variant(&'s self) -> Variants<'value>

source

pub fn get_ref(&'s self) -> ValueRef<'value>

source§

impl<'s, 'value, T, V> Opaque<T, [V]>where T: AsVariant<'s, 'value>,

source

pub fn len(&'s self) -> usize

source

pub fn get_array(&'s self) -> GcRef<'value, ValueArray>

source

pub fn get(&'s self, index: VmInt) -> Option<OpaqueRef<'value, V>>

source

pub fn iter(&'s self) -> Iter<'s, 'value, T, V>

source§

impl<T, V> Opaque<RootedValue<T>, [V]>where T: VmRootInternal,

source

pub fn get2<'value>(&'value self, index: VmInt) -> Option<V>where V: for<'vm> Getable<'vm, 'value>,

Trait Implementations§

source§

impl<T, V> AsRef<V> for Opaque<T, V>where V: ?Sized, Self: Deref<Target = V>,

source§

fn as_ref(&self) -> &V

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T, V> Borrow<V> for Opaque<T, V>where V: ?Sized, Self: Deref<Target = V>,

source§

fn borrow(&self) -> &V

Immutably borrows from an owned value. Read more
source§

impl<T, V> Clone for Opaque<T, V>where T: Clone,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, V> Debug for Opaque<T, V>where T: Debug,

source§

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

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

impl<T, V> Deref for Opaque<T, [V]>where T: AsValueRef, V: ArrayRepr + Copy,

§

type Target = [V]

The resulting type after dereferencing.
source§

fn deref(&self) -> &[V]

Dereferences the value.
source§

impl<'s, 'value, T> Deref for Opaque<T, GcPtr<ClosureData>>where T: AsVariant<'s, 'value>,

§

type Target = GcPtr<ClosureData>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<T, V> Deref for Opaque<T, V>where T: AsValueRef, V: Userdata,

§

type Target = V

The resulting type after dereferencing.
source§

fn deref(&self) -> &V

Dereferences the value.
source§

impl<T> Deref for Opaque<T, str>where T: AsValueRef,

§

type Target = str

The resulting type after dereferencing.
source§

fn deref(&self) -> &str

Dereferences the value.
source§

impl<T, V> Ord for Opaque<T, V>where T: AsValueRef, Self: Borrow<V>, V: ?Sized + Ord,

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<T, V> PartialEq<Opaque<T, V>> for Opaque<T, V>where T: AsValueRef, Self: Borrow<V>, V: ?Sized + PartialEq,

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, V> PartialOrd<Opaque<T, V>> for Opaque<T, V>where T: AsValueRef, Self: Borrow<V>, V: ?Sized + PartialOrd,

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<'s, 'value, 'vm, T, V> Pushable<'vm> for Opaque<T, V>where T: Pushable<'vm>, V: ?Sized,

source§

fn vm_push(self, context: &mut ActiveThread<'vm>) -> Result<()>

Pushes self to stack. If the call is successful a single element should have been added to the stack and Ok(()) should be returned. If the call is unsuccessful Status:Error should be returned and the stack should be left intact
source§

fn status_push(self, context: &mut ActiveThread<'vm>) -> Statuswhere Self: Sized,

source§

unsafe fn marshal_unrooted(self, vm: &'vm Thread) -> Result<Value>where Self: Sized,

source§

fn marshal<T>(self, vm: &'vm Thread) -> Result<RootedValue<T>>where Self: Sized, T: VmRoot<'vm>,

source§

impl<T> Serialize for Opaque<T, str>where T: AsValueRef,

source§

fn serialize<S>(&self, serializer: S) -> StdResult<S::Ok, S::Error>where S: Serializer,

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

impl<T> SerializeState<Thread> for Opaque<T, str>where T: AsValueRef,

source§

fn serialize_state<S>( &self, serializer: S, _thread: &Thread ) -> StdResult<S::Ok, S::Error>where S: Serializer,

Serializes self
source§

impl<T, V> Trace for Opaque<T, V>where T: Trace,

source§

unsafe fn root(&mut self)

source§

unsafe fn unroot(&mut self)

source§

fn trace(&self, gc: &mut Gc)

source§

impl<T, V> VmType for Opaque<T, V>where V: ?Sized + VmType, V::Type: Sized,

§

type Type = <V as VmType>::Type

A version of Self which implements Any allowing a TypeId to be retrieved
source§

fn make_type(vm: &Thread) -> ArcType

Creates an gluon type which maps to Self in rust
source§

const EXTRA_ARGS: VmIndex = V::EXTRA_ARGS

How many extra arguments a function returning this type requires. Used for abstract types which when used in return position should act like they still need more arguments before they are called
source§

fn make_forall_type(vm: &Thread) -> ArcType

source§

impl<T, V> Eq for Opaque<T, V>where T: AsValueRef, Self: Borrow<V>, V: ?Sized + Eq,