Struct selinux::seq_lock::SeqLock

source ·
pub struct SeqLock<H: AsBytes + NoCell, T: AsBytes + NoCell> { /* private fields */ }
Expand description

Declare an instance of SeqLock by supplying header([H]) and value([T]) types, which should be configured with C-style layout & alignment. SeqLock will place a 32-bit atomic sequence number in-between the header and value, in a VMO.

Implementations§

source§

impl<H: AsBytes + Default + NoCell, T: AsBytes + Default + NoCell> SeqLock<H, T>

source

pub fn new_default() -> Result<Self, Status>

source§

impl<H: AsBytes + NoCell, T: AsBytes + NoCell> SeqLock<H, T>

source

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.

source

pub fn get_readonly_vmo(&self) -> Arc<Vmo>

Returns a read-only handle to the VMO containing the header, atomic sequence number, and value.

source

pub fn set_value(&mut self, value: T)

Updates the value held by this instance using the Seqlock pattern.

Trait Implementations§

source§

impl<H: AsBytes + NoCell, T: AsBytes + NoCell> Drop for SeqLock<H, T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<H, T> Freeze for SeqLock<H, T>

§

impl<H, T> RefUnwindSafe for SeqLock<H, T>

§

impl<H, T> Send for SeqLock<H, T>
where H: Send, T: Send,

§

impl<H, T> Sync for SeqLock<H, T>
where H: Sync, T: Sync,

§

impl<H, T> Unpin for SeqLock<H, T>
where H: Unpin, T: Unpin,

§

impl<H, T> UnwindSafe for SeqLock<H, T>
where H: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<B, A> LockBefore<B> for A
where B: LockAfter<A>,

source§

impl<B, A> LockEqualOrBefore<B> for A
where A: LockBefore<B>,