Struct mozjs::gc::RootedTraceableBox
source · pub struct RootedTraceableBox<T: Traceable + 'static> {
ptr: *mut T,
}
Expand description
Roots any JSTraceable thing
If you have GC things like *mut JSObject or JSVal, use rooted!. If you know what you’re doing, use this.
Fields§
§ptr: *mut T
Implementations§
source§impl<T: Traceable + 'static> RootedTraceableBox<T>
impl<T: Traceable + 'static> RootedTraceableBox<T>
sourcepub fn new(traceable: T) -> RootedTraceableBox<T>
pub fn new(traceable: T) -> RootedTraceableBox<T>
Root a JSTraceable thing for the life of this RootedTraceableBox
sourcepub fn from_box(boxed_traceable: Box<T>) -> RootedTraceableBox<T>
pub fn from_box(boxed_traceable: Box<T>) -> RootedTraceableBox<T>
Consumes a boxed JSTraceable and roots it for the life of this RootedTraceableBox.
Trait Implementations§
source§impl<T: Traceable> DerefMut for RootedTraceableBox<T>
impl<T: Traceable> DerefMut for RootedTraceableBox<T>
source§impl<T: Traceable + 'static> Drop for RootedTraceableBox<T>
impl<T: Traceable + 'static> Drop for RootedTraceableBox<T>
source§impl<T: Traceable + 'static> Traceable for RootedTraceableBox<T>
impl<T: Traceable + 'static> Traceable for RootedTraceableBox<T>
Auto Trait Implementations§
impl<T> Freeze for RootedTraceableBox<T>
impl<T> RefUnwindSafe for RootedTraceableBox<T>where
T: RefUnwindSafe,
impl<T> !Send for RootedTraceableBox<T>
impl<T> !Sync for RootedTraceableBox<T>
impl<T> Unpin for RootedTraceableBox<T>
impl<T> UnwindSafe for RootedTraceableBox<T>where
T: RefUnwindSafe,
Blanket Implementations§
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<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more