Struct js::rust::RootedGuard
[−]
[src]
pub struct RootedGuard<'a, T: 'a + RootKind + GCMethods> { /* fields omitted */ }
Rust API for keeping a Rooted value in the context's root stack.
Example usage: rooted!(in(cx) let x = UndefinedValue());
.
RootedGuard::new
also works, but the macro is preferred.
Methods
impl<'a, T: 'a + RootKind + GCMethods> RootedGuard<'a, T>
[src]
pub fn new(cx: *mut JSContext, root: &'a mut Rooted<T>, initial: T) -> Self
[src]
pub fn handle(&self) -> Handle<T>
[src]
pub fn handle_mut(&mut self) -> MutableHandle<T>
[src]
pub fn get(&self) -> T where
T: Copy,
[src]
T: Copy,
pub fn set(&mut self, v: T)
[src]
Trait Implementations
impl<'a, T: 'a + RootKind + GCMethods> Deref for RootedGuard<'a, T>
[src]
type Target = T
The resulting type after dereferencing.
fn deref(&self) -> &T
[src]
Dereferences the value.