pub struct Opaque<T, V>(/* private fields */)
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§
source§impl<T, V> Opaque<RootedValue<T>, V>where
T: VmRootInternal,
V: ?Sized,
impl<T, V> Opaque<RootedValue<T>, V>where T: VmRootInternal, V: ?Sized,
source§impl<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§
source§impl<'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>,
source§impl<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,
source§impl<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,
source§impl<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,
1.0.0 · source§fn 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 moresource§impl<'s, 'value, 'vm, T, V> Pushable<'vm> for Opaque<T, V>where
T: Pushable<'vm>,
V: ?Sized,
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<()>
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 intactfn 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>,
source§impl<T> SerializeState<Thread> for Opaque<T, str>where
T: AsValueRef,
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,
fn serialize_state<S>( &self, serializer: S, _thread: &Thread ) -> StdResult<S::Ok, S::Error>where S: Serializer,
Serializes
self
source§impl<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 retrievedsource§const EXTRA_ARGS: VmIndex = V::EXTRA_ARGS
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
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§
source§impl<'vm, T> AsyncPushable<'vm> for Twhere
T: Pushable<'vm>,
impl<'vm, T> AsyncPushable<'vm> for Twhere T: Pushable<'vm>,
source§fn async_push(
self,
context: &mut ActiveThread<'vm>,
lock: Lock,
_: u32
) -> Poll<Result<(), Error>>
fn async_push( self, context: &mut ActiveThread<'vm>, lock: Lock, _: u32 ) -> Poll<Result<(), 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>, lock: Lock, frame_index: VmIndex ) -> Statuswhere Self: Sized,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.