pub struct Shared<T> { /* private fields */ }Expand description
§Safety
Shared<T> is a manually managed, stack-based shared smart pointer.
It allows you to take multiple shared references, or a single unique one,
but it does not perform any runtime checks — soundness relies on you
upholding aliasing rules.
Implementations§
Sourcepub fn take_ref(&mut self) -> SharedRef<'_, T>
pub fn take_ref(&mut self) -> SharedRef<'_, T>
Takes a temporary shared reference to the value.
§Safety
This is only safe if the returned reference does not outlive self.
The borrow checker enforces this, so in safe Rust usage, this method is sound.
Sourcepub fn raw(&self) -> &UnsafeShared<T>
pub fn raw(&self) -> &UnsafeShared<T>
Internal helper if you ever need to extract the raw shared handle.
Trait Implementations§
Auto Trait Implementations§
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