pub struct RuntimeBuilder { /* private fields */ }Expand description
Runtime configuration.
Implementations§
Source§impl RuntimeBuilder
impl RuntimeBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
New builder with empty auth registry, default capabilities, and the
crate’s identity (arcp-rs).
Sourcepub fn with_authenticator(self, auth: Box<dyn Authenticator>) -> Self
pub fn with_authenticator(self, auth: Box<dyn Authenticator>) -> Self
Register one authenticator. Multiple may be added (one per scheme).
Sourcepub fn with_tools(self, tools: ToolRegistry) -> Self
pub fn with_tools(self, tools: ToolRegistry) -> Self
Set the tool registry (replaces any previously set).
Sourcepub fn with_capabilities(self, caps: Capabilities) -> Self
pub fn with_capabilities(self, caps: Capabilities) -> Self
Set the capability set the runtime advertises.
Sourcepub fn with_identity(self, ident: RuntimeIdentity) -> Self
pub fn with_identity(self, ident: RuntimeIdentity) -> Self
Override the runtime identity.
Sourcepub const fn with_session_lease_seconds(self, seconds: u64) -> Self
pub const fn with_session_lease_seconds(self, seconds: u64) -> Self
Override the default session lease length.
Sourcepub const fn with_ack_window(self, window: u64) -> Self
pub const fn with_ack_window(self, window: u64) -> Self
Set the size of the session.ack sliding window (ARCP v1.1 §6.5).
When set, the writer will pause outbound countable envelopes once
emitted - last_processed_seq >= window and resume on the next
session.ack. Set to None (default) to disable window-based
flow control entirely.
A window of 0 makes the gate immediately unsatisfiable for the
very first countable event and is normalized to None
(disabled) rather than installing a guaranteed deadlock.
Sourcepub fn with_credential_provisioner(
self,
provisioner: Arc<dyn CredentialProvisioner>,
) -> Self
pub fn with_credential_provisioner( self, provisioner: Arc<dyn CredentialProvisioner>, ) -> Self
Register a provisioner for ARCP v1.1 lease-bound credentials.
Sourcepub async fn build(self) -> Result<ARCPRuntime, ARCPError>
pub async fn build(self) -> Result<ARCPRuntime, ARCPError>
Construct an ARCPRuntime sharing this configuration. The
returned runtime is cheap to clone.
§Errors
Returns ARCPError::Storage if the in-memory event log cannot be
initialised (extremely unlikely; signals SQLite link failure).