JournalRegion4

Struct JournalRegion4 

Source
pub struct JournalRegion4 { /* private fields */ }
Expand description

File-backed journal region (concrete v1 layout).

See EventsRegion for the creator/joiner initialization model.

Implementations§

Source§

impl JournalRegion4

Source

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

Open (or create) a journal region using the default path for name.

Source

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

Open (or create) a journal region using explicit options.

Source

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

Open (or create) a journal region backed by path.

Source

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

Open (or create) a journal region backed by path with explicit options.

See EventsRegion::open_path_with for error semantics.

Source

pub fn flush(&self) -> Result<()>

Flush modified pages to the underlying file (best-effort durability).

Source

pub fn flush_async(&self) -> Result<()>

Flush modified pages asynchronously.

Source

pub fn as_ptr(&self) -> *mut JournalLayout4

Get the raw layout pointer for this mapping.

The pointer is valid as long as the JournalRegion4 is alive.

Source

pub fn publisher( &mut self, cfg: JournalPublisherConfig, ) -> Result<JournalPublisher, Error>

Create a journal publisher.

Source

pub fn subscriber( &mut self, idx: usize, start_pos: u64, ) -> Result<JournalSubscriber, Error>

Create a journal subscriber at idx starting from start_pos.

Source

pub fn subscriber_with_config( &mut self, idx: usize, start_pos: u64, cfg: JournalSubscriberConfig, ) -> Result<JournalSubscriber, Error>

Create a journal subscriber with explicit configuration.

Trait Implementations§

Auto Trait Implementations§

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.