Struct servo_arc::ArcBorrow
[−]
[src]
pub struct ArcBorrow<'a, T: 'a>(_);
A "borrowed Arc". This is a pointer to a T that is known to have been allocated within an Arc.
This is equivalent in guarantees to &Arc<T>
, however it is
a bit more flexible. To obtain an &Arc<T>
you must have
an Arc
However, Gecko hands us refcounted things as pointers to T directly, so we have to conjure up a temporary Arc on the stack each time. The same happens for when the object is managed by a RawOffsetArc.
ArcBorrow lets us deal with borrows of known-refcounted objects without needing to worry about how they're actually stored.
Methods
impl<'a, T> ArcBorrow<'a, T>
[src]
pub fn clone_arc(&self) -> Arc<T>
[src]
pub unsafe fn from_ref(r: &'a T) -> Self
[src]
For constructing from a reference known to be Arc-backed, e.g. if we obtain such a reference over FFI
pub fn with_arc<F, U>(&self, f: F) -> U where
F: FnOnce(&Arc<T>) -> U,
T: 'static,
[src]
F: FnOnce(&Arc<T>) -> U,
T: 'static,
Trait Implementations
impl<'a, T: Eq + 'a> Eq for ArcBorrow<'a, T>
[src]
impl<'a, T: PartialEq + 'a> PartialEq for ArcBorrow<'a, T>
[src]
fn eq(&self, __arg_0: &ArcBorrow<'a, T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ArcBorrow<'a, T>) -> bool
[src]
This method tests for !=
.
impl<'a, T> Copy for ArcBorrow<'a, T>
[src]
impl<'a, T> Clone for ArcBorrow<'a, T>
[src]
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more