#[repr(C)]pub struct WeakSlice<T, Alloc: IAlloc = DefaultAllocator> { /* private fields */ }Expand description
A weak reference counted slice.
Implementations§
Source§impl<T, Alloc: IAlloc> WeakSlice<T, Alloc>
impl<T, Alloc: IAlloc> WeakSlice<T, Alloc>
Sourcepub const fn has_optimal_layout() -> bool
pub const fn has_optimal_layout() -> bool
Returns true if the layout for WeakSlice is smaller or equal to that Rust would have generated for it.
Source§impl<T, Alloc: IAlloc> WeakSlice<T, Alloc>
impl<T, Alloc: IAlloc> WeakSlice<T, Alloc>
Sourcepub fn upgrade(&self) -> Option<ArcSlice<T, Alloc>>
pub fn upgrade(&self) -> Option<ArcSlice<T, Alloc>>
Return a strong reference to the slice if it hasn’t been destroyed yet.
Sourcepub fn force_upgrade(&self) -> ArcSlice<T, Alloc>where
T: Copy,
pub fn force_upgrade(&self) -> ArcSlice<T, Alloc>where
T: Copy,
For types that are Copy, the slice actually remains valid even after all strong references
have been dropped as long as at least a weak reference lives on.
If you’re using this, there are probably design issues in your program…
Trait Implementations§
Source§impl<T, Alloc: IAlloc> IStable for WeakSlice<T, Alloc>
impl<T, Alloc: IAlloc> IStable for WeakSlice<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<AllocSlice<T, Alloc>> as IStable>::ForbiddenValues
type ForbiddenValues = <Struct<AllocSlice<T, Alloc>> as IStable>::ForbiddenValues
The values that the annotated type cannot occupy.
Source§type UnusedBits = <Struct<AllocSlice<T, Alloc>> as IStable>::UnusedBits
type UnusedBits = <Struct<AllocSlice<T, Alloc>> as IStable>::UnusedBits
The padding bits in the annotated types
Source§type Size = <Struct<AllocSlice<T, Alloc>> as IStable>::Size
type Size = <Struct<AllocSlice<T, Alloc>> as IStable>::Size
The size of the annotated type in bytes.
Source§type Align = <Struct<AllocSlice<T, Alloc>> as IStable>::Align
type Align = <Struct<AllocSlice<T, Alloc>> as IStable>::Align
The alignment of the annotated type in bytes.
Source§type HasExactlyOneNiche = <Struct<AllocSlice<T, Alloc>> as IStable>::HasExactlyOneNiche
type HasExactlyOneNiche = <Struct<AllocSlice<T, Alloc>> as IStable>::HasExactlyOneNiche
Allows the detection of whether or not
core::option::Options are stable: Read moreSource§type ContainsIndirections = <Struct<AllocSlice<T, Alloc>> as IStable>::ContainsIndirections
type ContainsIndirections = <Struct<AllocSlice<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 WeakSlice<T, Alloc>
impl<T: Send + Sync, Alloc: IAlloc + Send + Sync> Sync for WeakSlice<T, Alloc>
Auto Trait Implementations§
impl<T, Alloc> Freeze for WeakSlice<T, Alloc>
impl<T, Alloc> RefUnwindSafe for WeakSlice<T, Alloc>where
Alloc: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, Alloc> Unpin for WeakSlice<T, Alloc>
impl<T, Alloc> UnwindSafe for WeakSlice<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