pub struct IntegrationsWriteService { /* private fields */ }Implementations§
Source§impl IntegrationsWriteService
impl IntegrationsWriteService
pub fn new(pool: PgPool) -> Self
Sourcepub async fn register_connector(
&self,
c: NewConnector,
) -> Result<Uuid, IntegrationError>
pub async fn register_connector( &self, c: NewConnector, ) -> Result<Uuid, IntegrationError>
Register a connector to an external provider.
Sourcepub async fn receive_event(
&self,
e: InboundEvent,
mapper: &dyn TargetPort,
events: &dyn IntegrationEventSink,
) -> Result<ReceiveOutcome, IntegrationError>
pub async fn receive_event( &self, e: InboundEvent, mapper: &dyn TargetPort, events: &dyn IntegrationEventSink, ) -> Result<ReceiveOutcome, IntegrationError>
Receive an inbound event: dedup on (connector, external_id), map it to an internal action via the
TargetPort, and record the outcome. A retried webhook returns the original with duplicate=true —
it never re-maps. Emits IntegrationEventMapped / IntegrationEventFailed / IntegrationEventIgnored.
Sourcepub async fn failures(
&self,
connector_id: Uuid,
) -> Result<Vec<FailedEvent>, IntegrationError>
pub async fn failures( &self, connector_id: Uuid, ) -> Result<Vec<FailedEvent>, IntegrationError>
The failure report for a connector — the failed events with their keys + error — so an operator can see WHICH provider events (e.g. settled payments) failed to book, WITHOUT querying the private ledger (completeness council 2026-07-11).
Sourcepub async fn retry_failed(
&self,
company_id: Uuid,
connector_id: Uuid,
mapper: &dyn TargetPort,
events: &dyn IntegrationEventSink,
) -> Result<usize, IntegrationError>
pub async fn retry_failed( &self, company_id: Uuid, connector_id: Uuid, mapper: &dyn TargetPort, events: &dyn IntegrationEventSink, ) -> Result<usize, IntegrationError>
Re-drive a connector’s FAILED events through the target after the cause is fixed — the recovery path
the dedup would otherwise weld shut (a re-delivered webhook dedups and never re-maps). Re-invokes the
TargetPort under the SAME business-key idempotency the target enforces, so it can’t double-apply; a
still-failed event that now maps transitions failed → mapped. Returns the number newly mapped
(completeness council 2026-07-11).
company_id is the legacy tenancy twin (ADR-0029) — the module’s tables carry no company column,
but the re-mapped events still route to the TargetPort and the outbox/event payloads, which are
company-shaped; the CALLER (the composing host, which knows the tenant) names it, and an unknown
value fails closed at those edges, never inside this module.
Auto Trait Implementations§
impl !RefUnwindSafe for IntegrationsWriteService
impl !UnwindSafe for IntegrationsWriteService
impl Freeze for IntegrationsWriteService
impl Send for IntegrationsWriteService
impl Sync for IntegrationsWriteService
impl Unpin for IntegrationsWriteService
impl UnsafeUnpin for IntegrationsWriteService
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 more