pub struct RoutineDialer { /* private fields */ }Expand description
Reusable handle for the control plane’s RoutineService — the
manual-fire dev-path affordance (#1369).
The routine-enrollment ceremony trigger this type used to also carry was deleted in #1551: the prompt-routines pivot removed edge delivery and made sharing duplication-first, so no subscription/enrollment relationship returns.
Shares the AgentService endpoint (one internal Connect port), so it is
built from the same address an edge already holds.
Implementations§
Source§impl RoutineDialer
impl RoutineDialer
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 async fn fire_routine(
&self,
routine: &str,
occurrence: &str,
actor: ExternalIdentity,
admin_bearer: &str,
) -> Result<FiredRoutine, DialError>
pub async fn fire_routine( &self, routine: &str, occurrence: &str, actor: ExternalIdentity, admin_bearer: &str, ) -> Result<FiredRoutine, DialError>
Manually fire a routine right now (#1369) — the
standard way to test any routine without waiting for its schedule.
occurrence empty mints one from the current time
({routine}-{epoch_minutes}); non-empty is used verbatim, so a caller
can pin (or replay) an exact occurrence. The control plane’s admin
gate (#1489) requires, in order: admin_bearer presented as
Authorization: Bearer <admin_bearer> — the SAME admin-service
credential scheme POLYCHROME_ADMIN_SERVICE_KEYS seeds — verified
BEFORE the body is trusted at all, and only then actor resolved to
an admin persona. Neither alone is enough — an asserted actor with
no valid credential is refused just as a valid credential naming a
non-admin actor is.
Post-#1595 this is a clean no-op beyond routine resolution and
occurrence minting — the fixed-content fire path this call used to
hand resolved content templates to is retired.
admin_bearer is a per-call header, not one of this dialer’s default
headers (RoutineDialer::new dials without a bearer), so it goes
through the crate’s shared sensitive-HeaderValue construction site
directly rather than the shared default-HeaderMap builder every
other dialer’s with_bearer uses — same construction, same
set_sensitive marking, just built per call instead of once at dial
time.
§Errors
Returns DialError::InvalidBearer if admin_bearer can’t be
encoded as an HTTP header value, or DialError::Connect for any
transport/encoding error, which carries the control plane’s Connect
error (unknown routine, a missing or invalid admin_bearer, a
non-admin actor, or an unconfigured harness).
Trait Implementations§
Source§impl Clone for RoutineDialer
impl Clone for RoutineDialer
Source§fn clone(&self) -> RoutineDialer
fn clone(&self) -> RoutineDialer
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 RoutineDialer
impl !UnwindSafe for RoutineDialer
impl Freeze for RoutineDialer
impl Send for RoutineDialer
impl Sync for RoutineDialer
impl Unpin for RoutineDialer
impl UnsafeUnpin for RoutineDialer
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