pub struct NotificationDialer { /* private fields */ }Expand description
Reusable handle for the control plane’s NotificationService — the
pending-notification projection an edge drains to deliver operator DMs.
Shares the AgentService endpoint (one internal Connect port), so it is
built from the same address an edge already holds.
Implementations§
Source§impl NotificationDialer
impl NotificationDialer
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. NotificationService 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 poll_pending(
&self,
provider: &str,
) -> Result<Vec<PendingNotice>, DialError>
pub async fn poll_pending( &self, provider: &str, ) -> Result<Vec<PendingNotice>, DialError>
Drain undelivered operator notifications for provider ("slack" |
"telegram"). Read-only and idempotent — the durable mailbox is
unchanged until Self::ack.
§Errors
Returns DialError::Connect for any transport/encoding error.
Sourcepub async fn ack(
&self,
provider: &str,
action_id: &str,
target: &str,
) -> Result<bool, DialError>
pub async fn ack( &self, provider: &str, action_id: &str, target: &str, ) -> Result<bool, DialError>
Mark an (action_id, target) delivered after the DM is sent. Persists
an ops_action_delivered marker server-side so the projection survives
restart and never double-delivers. Idempotent: a redundant ack is
harmless.
§Errors
Returns DialError::Connect for any transport/encoding error.
Sourcepub async fn subscribe(
&self,
provider: &str,
) -> Result<impl Stream<Item = Result<PendingNotice, DialError>>, DialError>
pub async fn subscribe( &self, provider: &str, ) -> Result<impl Stream<Item = Result<PendingNotice, DialError>>, DialError>
Server-streaming replacement for Self::poll_pending (#803): opens a
long-lived Subscribe stream that pushes undelivered notifications for
provider as they’re durably recorded, instead of a fixed polling
interval. The initial connect ALSO catches a freshly (re)started edge up
on whatever is already undelivered — the same coverage a first
poll_pending call would give, just pushed rather than pulled.
§Errors
The outer Result carries DialError::Connect if opening the stream
fails. Each item is a Result so a later transport/decode error
surfaces inline without tearing down the whole stream.
Trait Implementations§
Source§impl Clone for NotificationDialer
impl Clone for NotificationDialer
Source§fn clone(&self) -> NotificationDialer
fn clone(&self) -> NotificationDialer
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 NotificationDialer
impl !UnwindSafe for NotificationDialer
impl Freeze for NotificationDialer
impl Send for NotificationDialer
impl Sync for NotificationDialer
impl Unpin for NotificationDialer
impl UnsafeUnpin for NotificationDialer
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