pub struct RegistryWriter { /* private fields */ }Expand description
Registers ScannedModule instances directly into an apcore Registry.
This is the default writer used when no output_format is specified. Instead of writing files, it registers modules directly for immediate use.
§Handler Resolution
By default (RegistryWriter::new()), modules are registered with a passthrough
handler that returns inputs unchanged — useful for schema-only registration
where execution is handled elsewhere.
For executable modules, use RegistryWriter::with_handler_factory(factory) to
provide a HandlerFactory that resolves target strings to real handlers.
Implementations§
Source§impl RegistryWriter
impl RegistryWriter
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a RegistryWriter with passthrough handlers (schema-only registration).
§Panics
This constructor does not panic. However, note that without a HandlerFactory,
all registered modules will use a passthrough handler that echoes inputs unchanged.
This is suitable for schema-only registration. For real execution, use
RegistryWriter::with_handler_factory to supply a factory that resolves targets
to actual async handlers.
Sourcepub fn with_handler_factory(factory: HandlerFactory) -> Self
pub fn with_handler_factory(factory: HandlerFactory) -> Self
Create a RegistryWriter with a custom handler factory for target resolution.
Source§impl RegistryWriter
impl RegistryWriter
Sourcepub fn write(
&self,
modules: &[ScannedModule],
registry: &mut Registry,
dry_run: bool,
verify: bool,
verifiers: Option<&[&dyn Verifier]>,
) -> Vec<WriteResult>
pub fn write( &self, modules: &[ScannedModule], registry: &mut Registry, dry_run: bool, verify: bool, verifiers: Option<&[&dyn Verifier]>, ) -> Vec<WriteResult>
Register scanned modules into the registry.
registry: The apcore Registry to register modules into.dry_run: If true, skip registration and return results only.verify: If true, verify modules are retrievable after registration.verifiers: Optional custom verifiers run after the built-in check.
§Verifier contract for registry-based modules
Registry modules have no output file, so custom verifiers receive
path = "". Built-in file-based verifiers (YAMLVerifier, JSONVerifier,
etc.) skip gracefully when path is empty. Custom verifiers must also
handle path = "" without erroring — use module_id for any
registry-based checks.