connector
Module: connector
Section titled “Module: connector”Contents
Section titled “Contents”Structs
ConnectorResponse- Response returned from a successful connector dispatch.
Enums
ConnectorError- Failure mode reported by a [Connector] implementation.
Traits
Connector- Translates an authorised [TransportView] into a target call and
firma_core::connector::Connector
Section titled “firma_core::connector::Connector”Trait
Translates an authorised [TransportView] into a target call and
returns the response.
Implementations are responsible only for protocol translation, technical constraints (rate limit, timeout, connection pooling), and credential merging from the view. Enforcement, capability verification, and credential sourcing happen upstream of this trait — see the module-level documentation for the boundary rules.
The trait uses [async_trait] because connector instances are
consumed as Arc<dyn Connector> through the sidecar registry, and
native async fn in traits does not yet support dyn under this
workspace’s configuration.
Errors
Section titled “Errors”Implementations return [ConnectorError] on dispatch failure. See
the variants on that type for the expected mapping.
Methods:
dispatch: Dispatches the request described byviewto the target
firma_core::connector::ConnectorError
Section titled “firma_core::connector::ConnectorError”Enum
Failure mode reported by a [Connector] implementation.
Variants map onto transport-level outcomes that the sidecar
translates into either an Aborted or a Deny response. See
the connector task specification (task 005) for the full table.
Target-side 4xx / 5xx responses are not represented here; they
are returned as [ConnectorResponse] with the upstream status
populated.
Variants:
Timeout(std::time::Duration)- Dispatch exceeded the configured timeout.Network(String)- Transport-layer failure reaching the target.InvalidRequest(String)- The envelope could not be translated into a well-formed
Traits: Error
Trait Implementations:
- Display
fn fmt(self: &Self, __formatter: & mut ::core::fmt::Formatter) -> ::core::fmt::Result
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
firma_core::connector::ConnectorResponse
Section titled “firma_core::connector::ConnectorResponse”Struct
Response returned from a successful connector dispatch.
Carries the raw target response (status, headers, body) together with outcome metadata that the sidecar uses to enrich the audit event emitted for the call.
response_size is pre-computed from body.len() so the audit
enrichment path does not have to re-measure the body.
Fields:
status: u16- HTTP-style status code returned by the target.headers: std::collections::HashMap<String, String>- Response headers returned by the target.body: Vec<u8>- Raw response body bytes returned by the target.dispatch_latency: std::time::Duration- Wall-clock latency measured around the dispatch call.response_size: usize- Byte length ofbody, pre-computed for audit.
Trait Implementations:
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
- Clone
fn clone(self: &Self) -> ConnectorResponse