pub struct SegRef<'a, T: ?Sized> { /* private fields */ }Expand description
Shared typed segment guard: a Ref<T> paired
with a SegmentLease that releases the registry entry on drop.
SegRef<T> derefs to T, so call sites written against the
previous Ref<T>-returning signatures compile unchanged in the
vast majority of cases (pattern bindings that explicitly named
Ref<'_, T> need the one-word substitution to SegRef<'_, T>).
Implementations§
Source§impl<'a, T: ?Sized> SegRef<'a, T>
impl<'a, T: ?Sized> SegRef<'a, T>
Sourcepub fn into_parts(self) -> (Ref<'a, T>, SegmentLease<'a>)
pub fn into_parts(self) -> (Ref<'a, T>, SegmentLease<'a>)
Consume the guard and return the underlying pointer.
The lease and account-level borrow are still released on drop of the returned components; this escape hatch is provided for rare generic plumbing.
Trait Implementations§
impl<T: ?Sized> HopperRefOnly for SegRef<'_, T>
Auto Trait Implementations§
impl<'a, T> Freeze for SegRef<'a, T>where
T: ?Sized,
impl<'a, T> RefUnwindSafe for SegRef<'a, T>where
T: RefUnwindSafe + ?Sized,
impl<'a, T> !Send for SegRef<'a, T>
impl<'a, T> !Sync for SegRef<'a, T>
impl<'a, T> Unpin for SegRef<'a, T>where
T: ?Sized,
impl<'a, T> UnsafeUnpin for SegRef<'a, T>where
T: ?Sized,
impl<'a, T> !UnwindSafe for SegRef<'a, T>
Blanket Implementations§
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