pub struct JournalConfig {Show 16 fields
pub max_object_size_bytes: u64,
pub max_decompressed_bytes: usize,
pub max_field_name_len: usize,
pub max_fields_per_entry: usize,
pub max_journal_files: usize,
pub max_open_files: usize,
pub mmap_policy: MmapPolicy,
pub max_object_chain_steps: usize,
pub max_query_terms: usize,
pub allow_mmap_online: bool,
pub include_journal_tilde: bool,
pub poll_interval: Duration,
pub live_channel_capacity: usize,
pub max_live_batch_entries: usize,
pub max_live_replay_entries: Option<usize>,
pub live_queue_full_policy: LiveQueueFullPolicy,
}Expand description
Runtime configuration for crate::Journal.
These limits are primarily defensive: they bound memory use and traversal work when reading malformed, truncated, or unexpectedly large journal files.
Defaults are conservative for general-purpose readers. Increase limits only for known-good
deployments with unusually large entries or many journal files. Lower
JournalConfig::poll_interval when live tail latency matters and a platform watcher is not
available.
Fields§
§max_object_size_bytes: u64Maximum object size accepted from the journal file.
This bounds allocation when reading ENTRY, DATA, and related objects.
max_decompressed_bytes: usizeMaximum bytes allowed after decompressing a DATA payload.
This protects callers from compressed payloads that expand unexpectedly.
max_field_name_len: usizeMaximum length of a field name.
systemd field names are normally short uppercase identifiers such as MESSAGE or
_SYSTEMD_UNIT.
max_fields_per_entry: usizeMaximum number of fields accepted per entry.
Entries exceeding this limit are treated as malformed or unsupported for this reader.
max_journal_files: usizeMaximum number of journal files included from a single scan.
Discovery fails with crate::SdJournalError::LimitExceeded if this limit is exceeded.
max_open_files: usizeMaximum journal files kept open by one reader.
Queries switch to a low-memory streaming merge when discovery finds more files than this
limit. Set this to 1 for the lowest file-descriptor and mmap footprint.
mmap_policy: MmapPolicyRuntime mmap policy.
MmapPolicy::Never forces bounded file I/O even when the mmap feature is enabled.
max_object_chain_steps: usizeMaximum number of steps when traversing any next_* chain.
This bounds work when following linked object chains in corrupt or adversarial files.
max_query_terms: usizeMaximum number of query terms (matches) accepted per query.
Unit helpers and OR groups can expand into several internal terms.
allow_mmap_online: boolWhether to allow mmap for STATE_ONLINE journal files that may still be written.
The default is false because concurrently modified files are safer to read through
explicit file I/O. Offline and archived files may still use mmap when the mmap feature is
enabled, unless JournalConfig::mmap_policy is MmapPolicy::Never.
include_journal_tilde: boolWhether to include *.journal~ temporary or incomplete files during discovery.
Keep this disabled unless the application explicitly wants best-effort access to temporary journal files.
poll_interval: DurationPolling interval used as fallback when inotify is unavailable or unreliable.
This affects crate::LiveJournal latency only on fallback polling paths.
live_channel_capacity: usizeMaximum queued live entries per subscription.
Live subscriptions use bounded queues. This prevents slow consumers from growing memory without limit.
max_live_batch_entries: usizeMaximum entries decoded or dispatched by one live-engine cycle.
Replay, topology refresh, and modified-file reads are split across multiple
crate::LiveJournal::poll_once cycles when more entries remain.
max_live_replay_entries: Option<usize>Optional maximum matching historical entries replayed for a single subscription.
None means the replay has no total entry cap, but work is still batched by
JournalConfig::max_live_batch_entries and delivered through bounded subscription queues.
Set this to Some(n) to fail with crate::SdJournalError::LimitExceeded after n
matching replay entries for a subscription.
live_queue_full_policy: LiveQueueFullPolicyBehavior when a subscription queue is full.
Trait Implementations§
Source§impl Clone for JournalConfig
impl Clone for JournalConfig
Source§fn clone(&self) -> JournalConfig
fn clone(&self) -> JournalConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more