pub struct Opaque<T, V>(_, _)
where
V: ?Sized;
Expand description
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.
Implementations
sourceimpl<T, V> Opaque<T, V>where
V: ?Sized,
impl<T, V> Opaque<T, V>where
V: ?Sized,
pub fn from_value(value: T) -> Self
pub fn into_inner(self) -> T
Trait Implementations
sourceimpl<'vm, 'value, V> Getable<'vm, 'value> for Opaque<Variants<'value>, V>where
V: ?Sized,
impl<'vm, 'value, V> Getable<'vm, 'value> for Opaque<Variants<'value>, V>where
V: ?Sized,
fn from_value(_vm: &'vm Thread, value: Variants<'value>) -> Self
sourceimpl<'a, T, V> IntoIterator for &'a Opaque<T, [V]>where
T: AsVariant<'a, 'a>,
impl<'a, T, V> IntoIterator for &'a Opaque<T, [V]>where
T: AsVariant<'a, 'a>,
sourceimpl<T, V> Ord for Opaque<T, V>where
T: AsValueRef,
Self: Borrow<V>,
V: ?Sized + Ord,
impl<T, V> Ord for Opaque<T, V>where
T: AsValueRef,
Self: Borrow<V>,
V: ?Sized + Ord,
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<T, V> PartialEq<Opaque<T, V>> for Opaque<T, V>where
T: AsValueRef,
Self: Borrow<V>,
V: ?Sized + PartialEq,
impl<T, V> PartialEq<Opaque<T, V>> for Opaque<T, V>where
T: AsValueRef,
Self: Borrow<V>,
V: ?Sized + PartialEq,
sourceimpl<T, V> PartialOrd<Opaque<T, V>> for Opaque<T, V>where
T: AsValueRef,
Self: Borrow<V>,
V: ?Sized + PartialOrd,
impl<T, V> PartialOrd<Opaque<T, V>> for Opaque<T, V>where
T: AsValueRef,
Self: Borrow<V>,
V: ?Sized + PartialOrd,
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
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 moresourceimpl<'s, 'value, 'vm, T, V> Pushable<'vm> for Opaque<T, V>where
T: Pushable<'vm>,
V: ?Sized + VmType,
V::Type: Sized,
impl<'s, 'value, 'vm, T, V> Pushable<'vm> for Opaque<T, V>where
T: Pushable<'vm>,
V: ?Sized + VmType,
V::Type: Sized,
sourcefn push(self, context: &mut ActiveThread<'vm>) -> Result<()>
fn 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 Read morefn status_push(self, context: &mut ActiveThread<'vm>) -> Statuswhere
Self: Sized,
unsafe fn marshal_unrooted(self, vm: &'vm Thread) -> Result<Value>where
Self: Sized,
fn marshal<T>(self, vm: &'vm Thread) -> Result<RootedValue<T>>where
Self: Sized,
T: VmRoot<'vm>,
sourceimpl<T, V> VmType for Opaque<T, V>where
V: ?Sized + VmType,
V::Type: Sized,
impl<T, V> VmType for Opaque<T, V>where
V: ?Sized + VmType,
V::Type: Sized,
type Type = <V as VmType>::Type
type Type = <V as VmType>::Type
A version of
Self
which implements Any
allowing a TypeId
to be retrievedsourcefn extra_args() -> VmIndex
fn extra_args() -> VmIndex
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 Read more
fn make_forall_type(vm: &Thread) -> ArcType
impl<T, V> Eq for Opaque<T, V>where
T: AsValueRef,
Self: Borrow<V>,
V: ?Sized + Eq,
Auto Trait Implementations
impl<T, V: ?Sized> RefUnwindSafe for Opaque<T, V>where
T: RefUnwindSafe,
V: RefUnwindSafe,
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,
impl<T, V: ?Sized> Unpin for Opaque<T, V>where
T: Unpin,
V: Unpin,
impl<T, V: ?Sized> UnwindSafe for Opaque<T, V>where
T: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
sourceimpl<'vm, T> AsyncPushable<'vm> for Twhere
T: Pushable<'vm>,
impl<'vm, T> AsyncPushable<'vm> for Twhere
T: Pushable<'vm>,
sourcefn async_push(
self,
context: &mut ActiveThread<'vm>,
_: u32
) -> Result<Async<()>, Error>
fn async_push(
self,
context: &mut ActiveThread<'vm>,
_: u32
) -> Result<Async<()>, Error>
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. Read morefn async_status_push(
self,
context: &mut ActiveThread<'vm>,
frame_index: VmIndex
) -> Statuswhere
Self: Sized,
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more