Skip to main content

ApprovalChannel

Trait ApprovalChannel 

Source
pub trait ApprovalChannel: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn dispatch(
        &self,
        request: &ApprovalRequest,
    ) -> Result<ChannelHandle, ChannelError>;
}
Expand description

Contract a channel must satisfy to dispatch an approval request.

The trait is sync; implementations that need async I/O should use a dedicated thread or a small runtime. WebhookChannel uses the blocking ureq client already in the crate’s dependency tree.

Required Methods§

Source

fn name(&self) -> &str

Short channel name ("webhook", "slack", "dashboard"…).

Source

fn dispatch( &self, request: &ApprovalRequest, ) -> Result<ChannelHandle, ChannelError>

Deliver an approval request to the configured endpoint. The channel implementation is responsible for retries; on terminal failure the call returns Err and the kernel leaves the request in the store (fail-closed).

Implementors§