pub struct ArrayInSHM<ID, Elem, ElemIndex>where
Standard: Distribution<ID>,
ID: SegmentID,{ /* private fields */ }Expand description
An SHM segment that is intended to be an array of elements of some certain type
Implementations§
Source§impl<ID, Elem, ElemIndex> ArrayInSHM<ID, Elem, ElemIndex>where
Standard: Distribution<ID>,
ID: SegmentID,
ElemIndex: Unsigned + PrimInt + 'static + AsPrimitive<usize>,
Elem: IStable<ContainsIndirections = B0>,
isize: AsPrimitive<ElemIndex>,
impl<ID, Elem, ElemIndex> ArrayInSHM<ID, Elem, ElemIndex>where
Standard: Distribution<ID>,
ID: SegmentID,
ElemIndex: Unsigned + PrimInt + 'static + AsPrimitive<usize>,
Elem: IStable<ContainsIndirections = B0>,
isize: AsPrimitive<ElemIndex>,
pub fn create(elem_count: NonZeroUsize) -> ZResult<Self>
pub fn open(id: ID) -> ZResult<Self>
pub fn id(&self) -> ID
pub fn elem_count(&self) -> NonZeroUsize
Sourcepub unsafe fn elem(&self, index: ElemIndex) -> *const Elem
pub unsafe fn elem(&self, index: ElemIndex) -> *const Elem
§Safety
Retrieves const element by it’s index. This is safe if the index doesn’t go out of underlying array. Additional assert to check the index validity is added for “test” feature
Sourcepub unsafe fn elem_mut(&self, index: ElemIndex) -> *mut Elem
pub unsafe fn elem_mut(&self, index: ElemIndex) -> *mut Elem
§Safety
Retrieves mut element by it’s index. This is safe if the index doesn’t go out of underlying array. Additional assert to check the index validity is added for “test” feature
Sourcepub unsafe fn index(&self, elem: *const Elem) -> ElemIndex
pub unsafe fn index(&self, elem: *const Elem) -> ElemIndex
§Safety
Calculates element’s index. This is safe if the element belongs to underlying array. Additional assert is added for “test” feature
Trait Implementations§
impl<ID, Elem: Send, ElemIndex> Send for ArrayInSHM<ID, Elem, ElemIndex>where
Standard: Distribution<ID>,
ID: SegmentID,
impl<ID, Elem: Sync, ElemIndex> Sync for ArrayInSHM<ID, Elem, ElemIndex>where
Standard: Distribution<ID>,
ID: SegmentID,
Auto Trait Implementations§
impl<ID, Elem, ElemIndex> Freeze for ArrayInSHM<ID, Elem, ElemIndex>where
ID: Freeze,
impl<ID, Elem, ElemIndex> RefUnwindSafe for ArrayInSHM<ID, Elem, ElemIndex>
impl<ID, Elem, ElemIndex> Unpin for ArrayInSHM<ID, Elem, ElemIndex>
impl<ID, Elem, ElemIndex> UnwindSafe for ArrayInSHM<ID, Elem, ElemIndex>
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