EventsChainRegion

Struct EventsChainRegion 

Source
pub struct EventsChainRegion<const Q: usize> { /* private fields */ }
Expand description

File-backed events-chain region (one slot pool + Q SPSC queues + Q MPSC queues of slot indices).

Implementations§

Source§

impl<const Q: usize> EventsChainRegion<Q>

Source

pub fn open(name: &str) -> Result<Self, Error>

Open (or create) an events-chain region using the default path for name.

Source

pub fn open_with(name: &str, options: OpenOptions) -> Result<Self, Error>

Open (or create) an events-chain region using explicit options.

Source

pub fn open_path(path: impl AsRef<Path>) -> Result<Self, Error>

Open (or create) an events-chain region backed by path.

Source

pub fn open_path_with( path: impl AsRef<Path>, options: OpenOptions, ) -> Result<Self, Error>

Open (or create) an events-chain region backed by path with explicit options.

Source

pub fn as_ptr(&self) -> *mut EventsChainLayout<Q>

Get the raw layout pointer for this mapping.

Source

pub fn mapping_info(&self) -> MappingInfo

Return OS-facing metadata about the mapped backing region.

Source

pub fn queue_spsc( &self, idx: usize, ) -> Result<(ChainSpscSender, ChainSpscReceiver), Error>

Split queue idx into (sender, receiver) handles.

This is a convenience wrapper around indexbus_core::split_chain_spsc.

Source

pub fn queue_mpsc( &self, idx: usize, ) -> Result<(ChainMpscProducer, ChainMpscConsumer), Error>

Split MPSC queue idx into (producer, consumer) handles.

This is a convenience wrapper around indexbus_core::split_chain_mpsc.

Trait Implementations§

Source§

impl<const Q: usize> Send for EventsChainRegion<Q>

Source§

impl<const Q: usize> Sync for EventsChainRegion<Q>

Auto Trait Implementations§

§

impl<const Q: usize> Freeze for EventsChainRegion<Q>

§

impl<const Q: usize> !RefUnwindSafe for EventsChainRegion<Q>

§

impl<const Q: usize> Unpin for EventsChainRegion<Q>

§

impl<const Q: usize> !UnwindSafe for EventsChainRegion<Q>

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>,

Source§

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>,

Source§

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.