Type Alias servo_arc::ThinArcUnion

source ·
pub type ThinArcUnion<H1, T1, H2, T2> = ArcUnion<HeaderSlice<H1, T1>, HeaderSlice<H2, T2>>;
Expand description

See ArcUnion. This is a version that works for ThinArcs.

Aliased Type§

struct ThinArcUnion<H1, T1, H2, T2> {
    pub(crate) p: NonNull<()>,
    pub(crate) phantom_a: PhantomData<HeaderSlice<H1, T1>>,
    pub(crate) phantom_b: PhantomData<HeaderSlice<H2, T2>>,
}

Fields§

§p: NonNull<()>§phantom_a: PhantomData<HeaderSlice<H1, T1>>§phantom_b: PhantomData<HeaderSlice<H2, T2>>

Implementations§

source§

impl<A, B> ArcUnion<A, B>

source

pub(crate) unsafe fn new(ptr: *mut ()) -> Self

source

pub fn ptr_eq(this: &Self, other: &Self) -> bool

Returns true if the two values are pointer-equal.

source

pub fn ptr(&self) -> NonNull<()>

source

pub fn borrow(&self) -> ArcUnionBorrow<'_, A, B>

Returns an enum representing a borrow of either A or B.

source

pub fn from_first(other: Arc<A>) -> Self

Creates an ArcUnion from an instance of the first type.

source

pub fn from_second(other: Arc<B>) -> Self

Creates an ArcUnion from an instance of the second type.

source

pub fn is_first(&self) -> bool

Returns true if this ArcUnion contains the first type.

source

pub fn is_second(&self) -> bool

Returns true if this ArcUnion contains the second type.

source

pub fn as_first(&self) -> Option<ArcBorrow<'_, A>>

Returns a borrow of the first type if applicable, otherwise None.

source

pub fn as_second(&self) -> Option<ArcBorrow<'_, B>>

Returns a borrow of the second type if applicable, otherwise None.

Trait Implementations§

source§

impl<A, B> Clone for ArcUnion<A, B>

source§

fn clone(&self) -> Self

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<A: Debug, B: Debug> Debug for ArcUnion<A, B>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<A, B> Drop for ArcUnion<A, B>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<A: PartialEq, B: PartialEq> PartialEq<ArcUnion<A, B>> for ArcUnion<A, B>

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<A: Eq, B: Eq> Eq for ArcUnion<A, B>

source§

impl<A: Sync + Send, B: Send + Sync> Send for ArcUnion<A, B>

source§

impl<A: Sync + Send, B: Send + Sync> Sync for ArcUnion<A, B>