pub struct InnerArc<Outer, Inner> {
outer: Outer,
elem: *const Inner,
}
Fieldsยง
ยงouter: Outer
ยงelem: *const Inner
Implementationsยง
Sourceยงimpl<Outer, Inner> InnerArc<Outer, Inner>
impl<Outer, Inner> InnerArc<Outer, Inner>
Sourcepub unsafe fn new<Arced, Err>(
outer: &Outer,
arc: impl FnOnce(&Outer) -> &Arc<Arced>,
get: impl FnOnce(&Arced) -> Result<&Inner, Err>,
) -> Result<Self, Err>where
Outer: Clone,
pub unsafe fn new<Arced, Err>(
outer: &Outer,
arc: impl FnOnce(&Outer) -> &Arc<Arced>,
get: impl FnOnce(&Arced) -> Result<&Inner, Err>,
) -> Result<Self, Err>where
Outer: Clone,
ยงSafety
Is only safe if the inner element is not behind inner mutability, and therefore cannot be moved around.
Sourcepub unsafe fn inherit<NewInner, Err>(
&self,
get: impl FnOnce(&Inner) -> Result<&NewInner, Err>,
) -> Result<InnerArc<Outer, NewInner>, Err>where
Outer: Clone,
pub unsafe fn inherit<NewInner, Err>(
&self,
get: impl FnOnce(&Inner) -> Result<&NewInner, Err>,
) -> Result<InnerArc<Outer, NewInner>, Err>where
Outer: Clone,
ยงSafety
Sourcepub unsafe fn new_from_outer<Err>(
outer: &Outer,
get: impl FnOnce(&Outer) -> Result<&Inner, Err>,
) -> Result<Self, Err>where
Outer: Clone,
pub unsafe fn new_from_outer<Err>(
outer: &Outer,
get: impl FnOnce(&Outer) -> Result<&Inner, Err>,
) -> Result<Self, Err>where
Outer: Clone,
ยงSafety
Is only safe if the inner element is not behind inner mutability, and therefore cannot be moved around and the provided reference is actually behind the Arc.
Sourcepub unsafe fn new_owned_infallible<'a, Arced>(
outer: Outer,
arc: impl FnOnce(&Outer) -> &Arc<Arced>,
get: impl FnOnce(&Arced) -> &'a Inner,
) -> Selfwhere
Outer: Clone + 'a,
Inner: 'a,
pub unsafe fn new_owned_infallible<'a, Arced>(
outer: Outer,
arc: impl FnOnce(&Outer) -> &Arc<Arced>,
get: impl FnOnce(&Arced) -> &'a Inner,
) -> Selfwhere
Outer: Clone + 'a,
Inner: 'a,
ยงSafety
Is only safe if the inner element is not behind inner mutability, and therefore cannot be moved around, and the provided reference is actually behind the Arc.
pub const fn outer(&self) -> &Outer
Trait Implementationsยง
impl<Outer: Send, Inner> Send for InnerArc<Outer, Inner>
impl<Outer: Sync, Inner> Sync for InnerArc<Outer, Inner>
Auto Trait Implementationsยง
impl<Outer, Inner> Freeze for InnerArc<Outer, Inner>where
Outer: Freeze,
impl<Outer, Inner> RefUnwindSafe for InnerArc<Outer, Inner>where
Outer: RefUnwindSafe,
Inner: RefUnwindSafe,
impl<Outer, Inner> Unpin for InnerArc<Outer, Inner>where
Outer: Unpin,
impl<Outer, Inner> UnwindSafe for InnerArc<Outer, Inner>where
Outer: UnwindSafe,
Inner: RefUnwindSafe,
Blanket Implementationsยง
ยงimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
ยงtype ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
ยงfn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
ยงimpl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
ยงfn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
ยงimpl<T> Instrument for T
impl<T> Instrument for T
ยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
ยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more