[][src]Struct gluon_vm::api::Opaque

pub struct Opaque<T, V>(_, _)
where
    V: ?Sized
;

Type implementing both Pushable and Getable of values of V regardless of wheter V implements the traits. The actual value, V is only accessible directly either by Deref if it is Userdata or a string or by the to_value method if it implements Getable.

When the value is not accessible the value can only be transferred back into gluon again without inspecting the value itself two different threads.

Methods

impl<T, V> Opaque<T, V> where
    V: ?Sized
[src]

pub fn from_value(value: T) -> Self[src]

pub fn into_inner(self) -> T[src]

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

pub unsafe fn get_value(&'s self) -> Value[src]

Unsafe as Value are not rooted

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

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

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

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

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

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

Trait Implementations

impl<T, V: ?Sized> VmType for Opaque<T, V> where
    V: VmType,
    V::Type: Sized
[src]

type Type = V::Type

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

fn make_forall_type(vm: &Thread) -> ArcType[src]

impl<'s, 'value, 'vm, T, V: ?Sized> Pushable<'vm> for Opaque<T, V> where
    T: Pushable<'vm>,
    V: VmType,
    V::Type: Sized
[src]

fn status_push(self, context: &mut ActiveThread<'vm>) -> Status where
    Self: Sized
[src]

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

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

impl<'vm, 'value, V> Getable<'vm, 'value> for Opaque<Variants<'value>, V> where
    V: ?Sized
[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0
[src]

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

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0
[src]

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

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0
[src]

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

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0
[src]

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

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

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

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

impl<'a, T, V> IntoIterator for &'a Opaque<T, [V]> where
    T: AsVariant<'a, 'a>, 
[src]

type Item = OpaqueRef<'a, V>

The type of the elements being iterated over.

type IntoIter = Iter<'a, 'a, T, V>

Which kind of iterator are we turning this into?

impl<T, V> Clone for Opaque<T, V> where
    T: Clone
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

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

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

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

Returns max if self is greater than max, and min if self is less than min. Otherwise this will return self. Panics if min > max. Read more

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

impl<T, V> Debug for Opaque<T, V> where
    T: Debug
[src]

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

type Target = V

The resulting type after dereferencing.

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

type Target = [V]

The resulting type after dereferencing.

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

type Target = str

The resulting type after dereferencing.

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

Auto Trait Implementations

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

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

Blanket Implementations

impl<'vm, T> AsyncPushable for T where
    T: Pushable<'vm>, 
[src]

fn async_status_push(
    self,
    context: &mut ActiveThread<'vm>,
    frame_index: VmIndex
) -> Status where
    Self: Sized
[src]

impl<'vm, T> Pushable for T where
    T: Userdata
[src]

fn status_push(self, context: &mut ActiveThread<'vm>) -> Status where
    Self: Sized
[src]

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

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

impl<D, T> FromPtr for T[src]

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

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

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

impl<T, U> TryInto 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<Choices> CoproductSubsetter for Choices[src]

type Remainder = Choices

impl<Source> Sculptor for Source[src]

type Remainder = Source

impl<T, U, I> LiftInto for T where
    U: LiftFrom<T, I>, 
[src]

impl<T> Any for T where
    T: Any
[src]