pub type TestTypedefInterface = Root<Dom<Blob>>;

Aliased Type§

struct TestTypedefInterface {
    value: Dom<Blob>,
    root_list: *const RootCollection,
}

Fields§

§value: Dom<Blob>

The value to root.

§root_list: *const RootCollection

List that ensures correct dynamic root ordering

Implementations§

source§

impl<T> Root<T>where T: StableTraceObject + 'static,

source

pub unsafe fn new(value: T) -> Self

Create a new stack-bounded root for the provided value. It cannot outlive its associated RootCollection, and it gives out references which cannot outlive this new Root.

source§

impl<T: Castable> Root<Dom<T>>

source

pub fn upcast<U>(root: Root<Dom<T>>) -> Root<Dom<U>>where U: Castable, T: DerivedFrom<U>,

Cast a DOM object root upwards to one of the interfaces it derives from.

source

pub fn downcast<U>(root: Root<Dom<T>>) -> Option<Root<Dom<U>>>where U: DerivedFrom<T>,

Cast a DOM object root downwards to one of the interfaces it might implement.

source§

impl<T: DomObject> Root<Dom<T>>

source

pub fn from_ref(unrooted: &T) -> Root<Dom<T>>

Generate a new root from a reference

Trait Implementations§

source§

impl<T> Clone for Root<Dom<T>>where T: DomObject,

source§

fn clone(&self) -> Root<Dom<T>>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> Deref for Root<T>where T: Deref + StableTraceObject,

§

type Target = <T as Deref>::Target

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<T> Drop for Root<T>where T: StableTraceObject,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<T: DomObject + IDLInterface> FromJSValConvertible for Root<Dom<T>>

§

type Config = ()

Optional configurable behaviour switch; use () for no configuration.
source§

unsafe fn from_jsval( cx: *mut JSContext, value: HandleValue<'_>, _config: Self::Config ) -> Result<ConversionResult<Root<Dom<T>>>, ()>

Convert val to type Self. Optional configuration of type T can be passed as the option argument. If it returns Err(()), a JSAPI exception is pending. If it returns Ok(Failure(reason)), there is no pending JSAPI exception.
source§

impl<T> MallocSizeOf for Root<Dom<T>>where T: DomObject + MallocSizeOf,

source§

fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.
source§

impl<T> PartialEq<Root<Dom<T>>> for Root<Dom<T>>where T: DomObject,

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: DomObject> ToJSValConvertible for Root<Dom<T>>

source§

unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue<'_>)

Convert self to a JSVal. JSAPI failure causes a panic.
source§

impl<T> Traceable for Root<Dom<T>>where T: DomObject,

source§

unsafe fn trace(&self, _: *mut JSTracer)

Trace self.