pub struct Rules {
pub table: FormatTable,
pub registry: Registry,
/* private fields */
}Expand description
The rules files loaded for one run.
The format table and the converter registry must declare the same
version. That shared version is recorded in every record as
rules_version.
Fields§
§table: FormatTableThe format table from rules/formats.toml.
registry: RegistryThe converter registry from rules/converters.toml.
Implementations§
Source§impl Rules
impl Rules
Sourcepub fn builtin_with_inventory(inventory: &RuntimeInventory) -> Result<Self>
pub fn builtin_with_inventory(inventory: &RuntimeInventory) -> Result<Self>
The rules compiled into the binary, with the deployment’s runtime-inventory paths wired into the pinned-engine converters. The expected hashes stay in the rules; the inventory supplies only paths.
Sourcepub fn builtin_with_runtime(
inventory: &RuntimeInventory,
provider: Option<&ProviderConfig>,
) -> Result<Self>
pub fn builtin_with_runtime( inventory: &RuntimeInventory, provider: Option<&ProviderConfig>, ) -> Result<Self>
The rules compiled into the binary, with the deployment’s runtime-inventory paths and its external provider configuration wired in.
A configured provider changes the effective rules version, so enabling, disabling, moving to different pinned executables, or changing the adapter re-runs every affected source instead of skipping it as unchanged. A configuration this build cannot run leaves the version alone and marks the run instead.
Sourcepub fn from_parts(table: FormatTable, registry: Registry) -> Result<Self>
pub fn from_parts(table: FormatTable, registry: Registry) -> Result<Self>
Rules over an explicit format table and registry, for a caller that compiled its own rules rather than the built-in ones. No provider is wired, so the effective version is the shared numeric version of the two tables.
Sourcepub fn from_parts_with_runtime(
table: FormatTable,
registry: Registry,
provider: Option<&ProviderConfig>,
) -> Result<Self>
pub fn from_parts_with_runtime( table: FormatTable, registry: Registry, provider: Option<&ProviderConfig>, ) -> Result<Self>
Rules over an explicit table and registry with the provider configuration the registry was built against, so the effective version carries the provider’s identity exactly as the built-in constructor’s does.
Sourcepub fn provider_not_built(&self) -> bool
pub fn provider_not_built(&self) -> bool
Whether a configured provider could not be built into this binary.
Auto Trait Implementations§
impl !RefUnwindSafe for Rules
impl !Send for Rules
impl !Sync for Rules
impl !UnwindSafe for Rules
impl Freeze for Rules
impl Unpin for Rules
impl UnsafeUnpin for Rules
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more