pub struct OperatorMailboxDialer { /* private fields */ }Expand description
Reusable handle for the control plane’s OperatorMailboxService — the
operator decision endpoint (authorize → evaluate → sign → record →
executor, all server-side).
Shares the AgentService endpoint (one internal Connect port), so it is
built from the same address an edge already holds.
Implementations§
Source§impl OperatorMailboxDialer
impl OperatorMailboxDialer
Sourcepub fn new(addr: &str) -> Result<Self, DialError>
pub fn new(addr: &str) -> Result<Self, DialError>
Build a dialer pointed at addr (expects http://host:port).
§Errors
Returns DialError::InvalidAddress if addr isn’t a valid URI, or
DialError::Tls if an https endpoint’s TLS setup fails.
Sourcepub fn with_bearer(addr: &str, bearer: &str) -> Result<Self, DialError>
pub fn with_bearer(addr: &str, bearer: &str) -> Result<Self, DialError>
Build a dialer pointed at addr, authenticated with bearer.
Every call this dialer makes carries an Authorization: Bearer <bearer> header. OperatorMailboxService doesn’t send AgentStart,
so no signed AssertedAttribution envelope rides these calls —
bearer-only.
§Errors
Returns DialError::InvalidAddress if addr isn’t a valid URI, or
DialError::InvalidBearer if bearer can’t be encoded as an HTTP
header value.
Sourcepub async fn decide(
&self,
action_id: &str,
approved: bool,
provider: &str,
external_user_id: &str,
reason: &str,
payload_hash: &str,
) -> Result<DecideResult, DialError>
pub async fn decide( &self, action_id: &str, approved: bool, provider: &str, external_user_id: &str, reason: &str, payload_hash: &str, ) -> Result<DecideResult, DialError>
Submit an operator decision for action_id. Authorization is
SERVER-SIDE: the edge forwards the (provider, external_user_id) it
already authenticated (Slack HMAC / Telegram secret_token) and the
control plane resolves it to an operator persona, refusing non-operators.
payload_hash is the WYSIWYS hash the edge displayed; the control plane
refuses an approval whose hash drifted from the live item.
Idempotent: a duplicate Approve click on an already-decided item is
DecideOutcome::Rejected, never double-applied.
§Errors
Returns DialError::Connect for any transport/encoding error.
Trait Implementations§
Source§impl Clone for OperatorMailboxDialer
impl Clone for OperatorMailboxDialer
Source§fn clone(&self) -> OperatorMailboxDialer
fn clone(&self) -> OperatorMailboxDialer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for OperatorMailboxDialer
impl !UnwindSafe for OperatorMailboxDialer
impl Freeze for OperatorMailboxDialer
impl Send for OperatorMailboxDialer
impl Sync for OperatorMailboxDialer
impl Unpin for OperatorMailboxDialer
impl UnsafeUnpin for OperatorMailboxDialer
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request