pub struct NativePluginRegistry { /* private fields */ }Expand description
Registry of built-in native plugins, split by pass.
Holding synth and regular plugins in separately-typed Vecs lets
the loader’s pass-dispatch site ask for the right kind directly:
the returned trait reference’s type matches the pass, so a
regular-pass plugin can’t be returned from find_synth even on a
name collision.
The loader still gates two implicit synth-pass invocations on
LoadOptions / Options flags (options.auto_accounts and the
option "documents" directive that drives document_discovery),
but those flow through the same unified dispatch loop as
file-declared and CLI plugins — there’s no per-plugin special
case at the dispatch site.
Implementations§
Source§impl NativePluginRegistry
impl NativePluginRegistry
Sourcepub fn global() -> &'static Self
pub fn global() -> &'static Self
Access the process-wide registry singleton.
The registry is immutable and stateless; reuse this reference
instead of constructing a fresh registry per call. The
underlying LazyLock initializes on first access.
Sourcepub fn find_synth(&self, name: &str) -> Option<&dyn SynthPlugin>
pub fn find_synth(&self, name: &str) -> Option<&dyn SynthPlugin>
Find a synth-pass plugin by name.
Returns None if the plugin doesn’t exist OR if it exists
but is a regular-pass plugin — the type system guarantees the
returned reference is dyn SynthPlugin.
Accepts both short names ("auto_accounts") and fully
qualified module paths ("beancount.plugins.auto_accounts").
Sourcepub fn find_regular(&self, name: &str) -> Option<&dyn RegularPlugin>
pub fn find_regular(&self, name: &str) -> Option<&dyn RegularPlugin>
Find a regular-pass plugin by name.
Returns None if the plugin doesn’t exist OR if it exists
but is a synth-pass plugin — the type system guarantees the
returned reference is dyn RegularPlugin.
Accepts both short names ("implicit_prices") and fully
qualified module paths ("beancount.plugins.implicit_prices").
Sourcepub fn iter(&self) -> impl Iterator<Item = &dyn NativePlugin>
pub fn iter(&self) -> impl Iterator<Item = &dyn NativePlugin>
Iterate every plugin in the registry, synth then regular.
Returns trait references upcast to the base NativePlugin —
callers that need pass information should use
Self::find_synth / Self::find_regular instead.
Sourcepub fn has(&self, name: &str) -> bool
pub fn has(&self, name: &str) -> bool
Check if a name refers to any plugin in this registry, in
either pass. Use this for existence queries; for invocation
use Self::find_synth / Self::find_regular so the
returned reference’s type carries the pass.
Auto Trait Implementations§
impl !RefUnwindSafe for NativePluginRegistry
impl !UnwindSafe for NativePluginRegistry
impl Freeze for NativePluginRegistry
impl Send for NativePluginRegistry
impl Sync for NativePluginRegistry
impl Unpin for NativePluginRegistry
impl UnsafeUnpin for NativePluginRegistry
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.