pub struct TaskApprovalRecord {
pub state: ApprovalState,
pub scope: Option<ApprovalScope>,
pub active_request: Option<ApprovalRequest>,
pub policy: ApprovalPolicy,
pub requests: Vec<ApprovalRequest>,
pub decisions: Vec<ApprovalDecision>,
pub requested_at: Option<DateTime<Utc>>,
pub decided_at: Option<DateTime<Utc>>,
pub decided_by: Option<String>,
pub note: Option<String>,
}Expand description
Approval details tracked per task.
Fields§
§state: ApprovalStateCurrent approval state.
scope: Option<ApprovalScope>Active scope being awaited, if any.
active_request: Option<ApprovalRequest>Active request awaiting a decision.
policy: ApprovalPolicyApproval policy derived for the task.
requests: Vec<ApprovalRequest>Historical requests.
decisions: Vec<ApprovalDecision>Historical decisions.
requested_at: Option<DateTime<Utc>>When approval was requested.
decided_at: Option<DateTime<Utc>>When a decision was made.
decided_by: Option<String>Actor that made the latest decision.
note: Option<String>Optional explanatory note.
Implementations§
Source§impl TaskApprovalRecord
impl TaskApprovalRecord
Sourcepub fn not_required(task: &DelegatedTask) -> Self
pub fn not_required(task: &DelegatedTask) -> Self
Build a record when no explicit gate is currently pending.
Sourcepub fn pending(
task: &DelegatedTask,
scope: ApprovalScope,
requested_by: ApprovalActor,
note: Option<String>,
) -> Self
pub fn pending( task: &DelegatedTask, scope: ApprovalScope, requested_by: ApprovalActor, note: Option<String>, ) -> Self
Build a record with an active request.
Sourcepub fn reset_for_task(&mut self, task: &DelegatedTask)
pub fn reset_for_task(&mut self, task: &DelegatedTask)
Reset the active gate state while preserving historical audit entries.
Sourcepub fn request(
&mut self,
scope: ApprovalScope,
requested_by: ApprovalActor,
note: Option<String>,
)
pub fn request( &mut self, scope: ApprovalScope, requested_by: ApprovalActor, note: Option<String>, )
Queue a new approval request while preserving prior audit entries.
Sourcepub fn latest_decision(&self) -> Option<&ApprovalDecision>
pub fn latest_decision(&self) -> Option<&ApprovalDecision>
Return the most recent decision, if any.
Sourcepub fn allowed_actor_kinds(&self, scope: ApprovalScope) -> &[ApprovalActorKind]
pub fn allowed_actor_kinds(&self, scope: ApprovalScope) -> &[ApprovalActorKind]
Resolve the list of allowed actors for the current scope.
Ensure the actor is authorized for the given approval scope.
Sourcepub fn record_decision(
&mut self,
scope: ApprovalScope,
decision: ApprovalDecisionKind,
actor: ApprovalActor,
note: Option<String>,
) -> Result<ApprovalDecision, String>
pub fn record_decision( &mut self, scope: ApprovalScope, decision: ApprovalDecisionKind, actor: ApprovalActor, note: Option<String>, ) -> Result<ApprovalDecision, String>
Record an explicit decision for the active request.
Trait Implementations§
Source§impl Clone for TaskApprovalRecord
impl Clone for TaskApprovalRecord
Source§fn clone(&self) -> TaskApprovalRecord
fn clone(&self) -> TaskApprovalRecord
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TaskApprovalRecord
impl Debug for TaskApprovalRecord
Source§impl Default for TaskApprovalRecord
impl Default for TaskApprovalRecord
Source§fn default() -> TaskApprovalRecord
fn default() -> TaskApprovalRecord
Source§impl<'de> Deserialize<'de> for TaskApprovalRecord
impl<'de> Deserialize<'de> for TaskApprovalRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TaskApprovalRecord
impl RefUnwindSafe for TaskApprovalRecord
impl Send for TaskApprovalRecord
impl Sync for TaskApprovalRecord
impl Unpin for TaskApprovalRecord
impl UnsafeUnpin for TaskApprovalRecord
impl UnwindSafe for TaskApprovalRecord
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().