Skip to main content

ControlHandler

Struct ControlHandler 

Source
pub struct ControlHandler { /* private fields */ }
Expand description

Real channel-0 control handler for subc itself.

Implementations§

Source§

impl ControlHandler

Source

pub fn new(registry: Arc<Registry>) -> Self

Source

pub fn with_forwarding( registry: Arc<Registry>, forwarding: Arc<ForwardingTable>, ) -> Self

Source

pub fn with_storage_config(self, storage_config: Option<StorageConfig>) -> Self

Set the central storage policy: registering modules then receive their resolved storage descriptor in HELLO_ACK.

Source

pub fn with_machine_id(self, machine_id: Option<MachineId>) -> Self

Set the machine id served to every registering module (HELLO_ACK) and on server.describe.

Source

pub fn with_admission_facts_config( self, carrier_module_id: Option<String>, targets: Option<Vec<String>>, ) -> Self

Configure the exact reserved module and target ids permitted to relay opaque admission facts. Config-file loading validates this authority; this builder keeps the same policy available to embedded test daemons.

Source

pub fn with_scope_authority_owners(self, owners: Vec<String>) -> Self

Set the module ids whose scopes may carry agent_id and delegates. Replaces the scope table with an empty one under the new list, so call it while building the handler, before any module can sync.

Source

pub fn with_route_bind_relay_timeout(self, timeout: Duration) -> Self

Override the route.bind relay timeout. Used by tests that assert the timeout path so they don’t block on the production-safe default.

Source

pub fn with_route_bind_relay_timeouts( self, timeouts: impl IntoIterator<Item = (String, Duration)>, ) -> Self

Install per-module route.bind relay budget overrides. A module id listed here wins over the daemon-wide default set via with_route_bind_relay_timeout. Values are pre-resolved at parse time from subc.jsonc (per-module > daemon-wide > absent), so callers pass the same Duration the bind path will use.

Source

pub fn route_bind_relay_timeout_for(&self, module_id: &str) -> Duration

Resolve the route.bind relay budget for a specific target module id. Per-module overrides win; the daemon-wide value (set via with_route_bind_relay_timeout or the built-in default) is the fallback. Exposed so config-aware callers (bootstrap, tests) can audit the same resolution handle_route_open will use.

Source

pub fn with_route_bind_breaker(self, threshold: u32, cooldown: Duration) -> Self

Override the per-module bind-relay breaker policy.

Used by tests, which cannot spend three production budgets opening a breaker or twenty seconds waiting for its cooldown. The production values are DEFAULT_ROUTE_BIND_BREAKER_THRESHOLD and DEFAULT_ROUTE_BIND_BREAKER_COOLDOWN, whose doc comments carry the reasoning for the numbers.

Source

pub fn with_process_liveness( self, process_liveness: Arc<dyn ModuleProcessLiveness>, ) -> Self

Source

pub fn with_supervisor(self, supervisor: SupervisorHandle) -> Self

Source

pub fn with_daemon_provenance( self, pid: u32, started_at_ms: u64, executable_path: Option<PathBuf>, build_git_sha: Option<String>, build_lock_digest: Option<String>, ) -> Self

Source

pub fn with_capability_config( self, modules: impl IntoIterator<Item = (String, bool)>, reserved_capabilities: BTreeMap<String, String>, ) -> Self

Install the configured module set and its reserved capability bindings. Bindings are configuration-scoped and may point at a provider that has not been installed yet, so this does not require the bound module to exist.

Source

pub fn with_supervisor_rescan( self, supervisor: Supervisor, config_path: impl Into<PathBuf>, configured_port: Option<u16>, ) -> Self

Source

pub fn with_connected_clients(self, connected_clients: ConnectedClients) -> Self

Source

pub fn forwarding(&self) -> Arc<ForwardingTable> ⓘ

Source

pub fn spawn_capability_deadline_loop(self: Arc<Self>)

Wake at each candidate’s own deadline so a stalled fresh exec emits its requirement event without depending on an operator polling a status command.

Source

pub fn refresh_capability_requirements(&self)

Source

pub async fn handle_control_frame( &self, ctx: &RouteCtx, frame: Frame, ) -> Result<Vec<Frame>, RouterError>

Source

pub fn cleanup_connection( &self, connection_id: ConnectionId, ) -> Result<Vec<ModuleRegistration>, RegistryError>

Trait Implementations§

Source§

impl Clone for ControlHandler

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ControlHandler

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ControlHandler

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more