pub struct JobOperator<R> { /* private fields */ }Expand description
The portable guarded operator application service.
The service enforces lifecycle, version, definition, checkpoint,
idempotency, and bounds. A deployment authenticates the caller and
authorizes OperatorRequest::authorization_class before invoking it.
Removing deployment authorization does not weaken a core guard.
Implementations§
Source§impl<R: JobRepository> JobOperator<R>
impl<R: JobRepository> JobOperator<R>
Sourcepub const fn new(repository: R, clock: Arc<dyn Clock>) -> Self
pub const fn new(repository: R, clock: Arc<dyn Clock>) -> Self
Binds one repository and one injected facade clock.
Sourcepub fn with_event_sink(self, sink: Arc<dyn TelemetryEventSink>) -> Self
pub fn with_event_sink(self, sink: Arc<dyn TelemetryEventSink>) -> Self
Attaches a non-authoritative, panic-isolated telemetry sink.
Sourcepub const fn repository(&self) -> &R
pub const fn repository(&self) -> &R
Borrows the underlying repository.
Sourcepub async fn execute(
&self,
request: &OperatorRequest,
) -> Result<OperatorOutcome, OperatorError>
pub async fn execute( &self, request: &OperatorRequest, ) -> Result<OperatorOutcome, OperatorError>
Applies one guarded, audited, idempotent operator action.
§Errors
Returns OperatorError::OperationIdConflict for a reused identifier
with a different canonical request,
OperatorError::OperationOutcomeUnknown for an ambiguous commit, and
OperatorError::Repository for an infrastructure failure. A guard
rejection is an audited OperatorOutcomeClass::Rejected outcome
rather than an error.
Trait Implementations§
Source§impl<R: Clone> Clone for JobOperator<R>
impl<R: Clone> Clone for JobOperator<R>
Source§fn clone(&self) -> JobOperator<R>
fn clone(&self) -> JobOperator<R>
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<R> !RefUnwindSafe for JobOperator<R>
impl<R> !UnwindSafe for JobOperator<R>
impl<R> Freeze for JobOperator<R>where
R: Freeze,
impl<R> Send for JobOperator<R>where
R: Send,
impl<R> Sync for JobOperator<R>where
R: Sync,
impl<R> Unpin for JobOperator<R>where
R: Unpin,
impl<R> UnsafeUnpin for JobOperator<R>where
R: UnsafeUnpin,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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