pub struct Weak<T: ?Sized = Erased> {
pub type_name: &'static str,
/* private fields */
}Expand description
Weak reference. Doesn’t affect reference counting.
Fields§
§type_name: &'static strImplementations§
Source§impl<T> Weak<T>
impl<T> Weak<T>
pub const fn const_default() -> Self
Source§impl<T: ?Sized> Weak<T>
impl<T: ?Sized> Weak<T>
pub fn sized(&self) -> bool
pub fn raw(&self) -> RawPointer
pub unsafe fn from_raw(ptr: RawPointer) -> Self
pub fn was_initialized(&self) -> bool
pub fn is_ok(&self) -> bool
pub fn is_null(&self) -> bool
pub fn get(&self) -> Option<&T>
pub fn get_mut(&mut self) -> Option<&mut T>
Sourcepub unsafe fn deref_unchecked(&self) -> &T
pub unsafe fn deref_unchecked(&self) -> &T
§Safety
Check state before usage
Sourcepub unsafe fn deref_unchecked_mut(&mut self) -> &mut T
pub unsafe fn deref_unchecked_mut(&mut self) -> &mut T
§Safety
Check state before usage
pub fn erase(&self) -> Weak
Trait Implementations§
Source§impl<T: Managed> ExistsManaged for Weak<T>
impl<T: Managed> ExistsManaged for Weak<T>
fn exists_managed(&self) -> bool
impl<T, U> CoerceUnsized<Weak<U>> for Weak<T>
impl<T: ?Sized> Copy for Weak<T>
impl<T> Eq for Weak<T>
impl<T: ?Sized> Send for Weak<T>
impl<T: ?Sized> Sync for Weak<T>
Auto Trait Implementations§
impl<T> Freeze for Weak<T>where
T: ?Sized,
impl<T> RefUnwindSafe for Weak<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Unpin for Weak<T>where
T: ?Sized,
impl<T> UnwindSafe for Weak<T>where
T: RefUnwindSafe + ?Sized,
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