Skip to main content

SeqLockable

Trait SeqLockable 

Source
pub unsafe trait SeqLockable: IntoBytes + Immutable {
    const WRITE_SIZE: WriteSize;
    const HAS_INLINE_SEQUENCE: bool;
    const VMO_NAME: &'static [u8];
}
Expand description

Types that are safe to be synchronized across address spaces using a Seqlock.

A type implementing this trait can optionally include the sequence as its first field, indicated by HAS_INLINE_SEQUENCE. If it does not, SeqLock will place a u32 atomic sequence number in between the header and value.

§Safety

Types implementing this trait guarantee that they can be safely written to shared memory in chunks of WRITE_SIZE without introducing undefined behavior for concurrent readers in other address spaces.

Required Associated Constants§

Source

const WRITE_SIZE: WriteSize

The chunk size to use when writing to memory, either 4 or 8 bytes.

Source

const HAS_INLINE_SEQUENCE: bool

Indicates whether the type includes the u32 sequence as its first field.

Source

const VMO_NAME: &'static [u8]

Name used to identify the VMO for debugging.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§