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 ThinArc
s.
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>
impl<A, B> ArcUnion<A, B>
pub(crate) unsafe fn new(ptr: *mut ()) -> Self
Sourcepub fn ptr_eq(this: &Self, other: &Self) -> bool
pub fn ptr_eq(this: &Self, other: &Self) -> bool
Returns true if the two values are pointer-equal.
pub fn ptr(&self) -> NonNull<()>
Sourcepub fn borrow(&self) -> ArcUnionBorrow<'_, A, B>
pub fn borrow(&self) -> ArcUnionBorrow<'_, A, B>
Returns an enum representing a borrow of either A or B.
Sourcepub fn from_first(other: Arc<A>) -> Self
pub fn from_first(other: Arc<A>) -> Self
Creates an ArcUnion
from an instance of the first type.
Sourcepub fn from_second(other: Arc<B>) -> Self
pub fn from_second(other: Arc<B>) -> Self
Creates an ArcUnion
from an instance of the second type.