#[repr(C)]pub struct Weak<T, Alloc: IAlloc = DefaultAllocator> { /* private fields */ }Expand description
alloc::sync::Weak, but ABI-stable.
Implementations§
Source§impl<T, Alloc: IAlloc> Weak<T, Alloc>
impl<T, Alloc: IAlloc> Weak<T, Alloc>
Sourcepub const fn has_optimal_layout() -> bool
pub const fn has_optimal_layout() -> bool
Returns true if the layout for Weak is smaller or equal to that Rust would have generated for it.
Source§impl<T, Alloc: IAlloc> Weak<T, Alloc>
impl<T, Alloc: IAlloc> Weak<T, Alloc>
Sourcepub const fn into_raw(this: Self) -> AllocPtr<T, Alloc>
pub const fn into_raw(this: Self) -> AllocPtr<T, Alloc>
Returns the pointer to the inner raw allocation, leaking this.
Note that the pointer may be dangling if T is zero-sized.
Sourcepub const unsafe fn from_raw(this: AllocPtr<T, Alloc>) -> Self
pub const unsafe fn from_raw(this: AllocPtr<T, Alloc>) -> Self
Constructs Self from a raw allocation.
§Safety
this MUST not be dangling, and have been obtained through Self::into_raw.
Trait Implementations§
Source§impl<T, Alloc: IAlloc> IPtrOwned for Weak<T, Alloc>
impl<T, Alloc: IAlloc> IPtrOwned for Weak<T, Alloc>
Source§fn drop(
this: &mut ManuallyDrop<Self>,
_drop: unsafe extern "C" fn(AnonymRefMut<'_>),
)
fn drop( this: &mut ManuallyDrop<Self>, _drop: unsafe extern "C" fn(AnonymRefMut<'_>), )
Called instead of
Drop::drop when the dynptr is dropped.Source§impl<T, Alloc: IAlloc> IStable for Weak<T, Alloc>
impl<T, Alloc: IAlloc> IStable for Weak<T, Alloc>
Source§const REPORT: &'static TypeReport
const REPORT: &'static TypeReport
A compile-time generated report of the fields of the type, allowing for compatibility inspection.
Source§const ID: u64
const ID: u64
A stable (and ideally unique) identifier for the type. Often generated using
crate::report::gen_id, but can be manually set.Source§type ForbiddenValues = <Struct<AllocPtr<T, Alloc>> as IStable>::ForbiddenValues
type ForbiddenValues = <Struct<AllocPtr<T, Alloc>> as IStable>::ForbiddenValues
The values that the annotated type cannot occupy.
Source§type UnusedBits = <Struct<AllocPtr<T, Alloc>> as IStable>::UnusedBits
type UnusedBits = <Struct<AllocPtr<T, Alloc>> as IStable>::UnusedBits
The padding bits in the annotated types
Source§type Size = <Struct<AllocPtr<T, Alloc>> as IStable>::Size
type Size = <Struct<AllocPtr<T, Alloc>> as IStable>::Size
The size of the annotated type in bytes.
Source§type Align = <Struct<AllocPtr<T, Alloc>> as IStable>::Align
type Align = <Struct<AllocPtr<T, Alloc>> as IStable>::Align
The alignment of the annotated type in bytes.
Source§type HasExactlyOneNiche = <Struct<AllocPtr<T, Alloc>> as IStable>::HasExactlyOneNiche
type HasExactlyOneNiche = <Struct<AllocPtr<T, Alloc>> as IStable>::HasExactlyOneNiche
Allows the detection of whether or not
core::option::Options are stable: Read moreSource§type ContainsIndirections = <Struct<AllocPtr<T, Alloc>> as IStable>::ContainsIndirections
type ContainsIndirections = <Struct<AllocPtr<T, Alloc>> as IStable>::ContainsIndirections
Whether or not the type contains indirections (pointers, indices in independent data-structures…)
impl<T: Send + Sync, Alloc: IAlloc + Send + Sync> Send for Weak<T, Alloc>
impl<T: Send + Sync, Alloc: IAlloc + Send + Sync> Sync for Weak<T, Alloc>
Auto Trait Implementations§
impl<T, Alloc> Freeze for Weak<T, Alloc>
impl<T, Alloc> RefUnwindSafe for Weak<T, Alloc>where
Alloc: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, Alloc> Unpin for Weak<T, Alloc>
impl<T, Alloc> UnwindSafe for Weak<T, Alloc>where
T: RefUnwindSafe,
Alloc: UnwindSafe,
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
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