pub struct SeqLock<H: IntoBytes + Immutable, T: IntoBytes + Immutable> { /* private fields */ }Expand description
Implementations§
Source§impl<H: IntoBytes + Default + Immutable, T: IntoBytes + Default + Immutable> SeqLock<H, T>
impl<H: IntoBytes + Default + Immutable, T: IntoBytes + Default + Immutable> SeqLock<H, T>
pub fn new_default() -> Result<Self, Status>
Source§impl<H: IntoBytes + Immutable, T: IntoBytes + Immutable> SeqLock<H, T>
impl<H: IntoBytes + Immutable, T: IntoBytes + Immutable> SeqLock<H, T>
Sourcepub fn new(header: H, value: T) -> Result<Self, Status>
pub fn new(header: H, value: T) -> Result<Self, Status>
Returns an instance with initial values and a read-only VMO handle. May fail if the VMO backing the structure cannot be created, duplicated read-only, or mapped.
Sourcepub unsafe fn new_from_vmo(
header: H,
value: T,
writable_vmo: Vmo,
) -> Result<Self, Status>
pub unsafe fn new_from_vmo( header: H, value: T, writable_vmo: Vmo, ) -> Result<Self, Status>
Same as new() except that we can pass in an existing Vmo. This means that the first part of the Vmo is a SeqLock.
§Safety
Callers must guarantee that any other references to this memory will only make aligned atomic accesses to the sequence offset within the memory or to fields of H or T.
Sourcepub fn get_readonly_vmo(&self) -> Arc<Vmo>
pub fn get_readonly_vmo(&self) -> Arc<Vmo>
Returns a read-only handle to the VMO containing the header, atomic sequence number, and value.
Sourcepub fn get_map_address(&mut self) -> *const T
pub fn get_map_address(&mut self) -> *const T
Retrieves the memory address of the beginning of the handle part of the VMO. You can use this to point to a param you want to edit (e.g. with an offset).
Trait Implementations§
Auto Trait Implementations§
impl<H, T> Freeze for SeqLock<H, T>
impl<H, T> RefUnwindSafe for SeqLock<H, T>where
H: RefUnwindSafe,
T: RefUnwindSafe,
impl<H, T> Send for SeqLock<H, T>
impl<H, T> Sync for SeqLock<H, T>
impl<H, T> Unpin for SeqLock<H, T>
impl<H, T> UnsafeUnpin for SeqLock<H, T>
impl<H, T> UnwindSafe for SeqLock<H, T>where
H: UnwindSafe,
T: UnwindSafe,
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more