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
impl JournalRegion4
Sourcepub fn open(name: &str) -> Result<Self, Error>
pub fn open(name: &str) -> Result<Self, Error>
Open (or create) a journal region using the default path for name.
Sourcepub fn open_with(name: &str, options: JournalOpenOptions) -> Result<Self, Error>
pub fn open_with(name: &str, options: JournalOpenOptions) -> Result<Self, Error>
Open (or create) a journal region using explicit options.
Sourcepub fn open_path(path: impl AsRef<Path>) -> Result<Self, Error>
pub fn open_path(path: impl AsRef<Path>) -> Result<Self, Error>
Open (or create) a journal region backed by path.
Sourcepub fn open_path_with(
path: impl AsRef<Path>,
options: JournalOpenOptions,
) -> Result<Self, Error>
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.
Sourcepub fn flush(&self) -> Result<()>
pub fn flush(&self) -> Result<()>
Flush modified pages to the underlying file (best-effort durability).
Sourcepub fn flush_async(&self) -> Result<()>
pub fn flush_async(&self) -> Result<()>
Flush modified pages asynchronously.
Sourcepub fn as_ptr(&self) -> *mut JournalLayout4
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.
Sourcepub fn publisher(
&mut self,
cfg: JournalPublisherConfig,
) -> Result<JournalPublisher, Error>
pub fn publisher( &mut self, cfg: JournalPublisherConfig, ) -> Result<JournalPublisher, Error>
Create a journal publisher.
Sourcepub fn subscriber(
&mut self,
idx: usize,
start_pos: u64,
) -> Result<JournalSubscriber, Error>
pub fn subscriber( &mut self, idx: usize, start_pos: u64, ) -> Result<JournalSubscriber, Error>
Create a journal subscriber at idx starting from start_pos.
Sourcepub fn subscriber_with_config(
&mut self,
idx: usize,
start_pos: u64,
cfg: JournalSubscriberConfig,
) -> Result<JournalSubscriber, Error>
pub fn subscriber_with_config( &mut self, idx: usize, start_pos: u64, cfg: JournalSubscriberConfig, ) -> Result<JournalSubscriber, Error>
Create a journal subscriber with explicit configuration.