pub type TrustedFileReader = Trusted<FileReader>;

Aliased Type§

struct TrustedFileReader {
    refcount: Arc<TrustedReference, Global>,
    owner_thread: *const LiveDOMReferences,
    phantom: PhantomData<FileReader>,
}

Fields§

§refcount: Arc<TrustedReference, Global>

A pointer to the Rust DOM object of type T, but void to allow sending Trusted<T> between threads, regardless of T’s sendability.

§owner_thread: *const LiveDOMReferences§phantom: PhantomData<FileReader>

Implementations§

source§

impl<T: DomObject> Trusted<T>

source

pub fn new(ptr: &T) -> Trusted<T>

Create a new Trusted<T> instance from an existing DOM pointer. The DOM object will be prevented from being GCed for the duration of the resulting Trusted<T> object’s lifetime.

source

pub fn root(&self) -> Root<Dom<T>>

Obtain a usable DOM pointer from a pinned Trusted<T> value. Fails if used on a different thread than the original value from which this Trusted<T> was obtained.

Trait Implementations§

source§

impl<T: DomObject> Clone for Trusted<T>

source§

fn clone(&self) -> Trusted<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: DomObject> Traceable for Trusted<T>

source§

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

Trace self.
source§

impl<T: DomObject> Send for Trusted<T>