pub struct RecordOptions { /* private fields */ }Expand description
How a record is written and read. The default is what publish_record
and RecordSlot have always done.
Implementations§
Source§impl RecordOptions
impl RecordOptions
Sourcepub const fn durable(self, durable: bool) -> Self
pub const fn durable(self, durable: bool) -> Self
Make the rename itself survive a crash, not only the contents.
On Unix the parent directory is synced after the rename. Windows has no
directory sync, so the record is flushed again after the rename,
through the publisher’s own handle. On a file system without POSIX
renames the record is reopened by name for that, and the open waits out
a concurrent replacement as RecordSlot::read does. An error from
that step means the record is in place but may not survive a crash.
Sourcepub const fn mode(self, mode: u32) -> Self
pub const fn mode(self, mode: u32) -> Self
Permission bits of a published record, set before any contents are written. Choosing anything wider than 0600 is the caller’s decision.
Sourcepub const fn read_limit(self, bytes: u64) -> Self
pub const fn read_limit(self, bytes: u64) -> Self
Largest record RecordSlot::read, RecordSlot::replace_if and
RecordSlot::remove_if read, in bytes. A longer one is refused.
repair and remove_if_matches keep their original comparison.