#[non_exhaustive]pub struct PendingRequest {
pub id: String,
pub actor: Subject,
pub mutation: Mutation,
pub requested_at: u64,
pub expires_at: Option<u64>,
pub status: PendingStatus,
pub impact: Option<Impact>,
pub elevation: Option<ElevationInfo>,
}Expand description
A change waiting for another actor.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: String§actor: SubjectWhoever proposed the change. The invariants judge the change as this actor, at proposal and at approval.
mutation: Mutation§requested_at: u64Milliseconds since the Unix epoch.
expires_at: Option<u64>From this instant on nobody can decide the request any more.
status: PendingStatus§impact: Option<Impact>What the change does to access: computed when it was proposed, and again when it was approved.
Absent when the flow ran without Approvals::with_impact.
elevation: Option<ElevationInfo>Present when the request is a time-boxed elevation (elevation).
Implementations§
Source§impl PendingRequest
impl PendingRequest
Sourcepub fn elevation_active(&self, now: u64) -> bool
pub fn elevation_active(&self, now: u64) -> bool
The request is an elevation that is approved, not revoked and inside its window at now.
Source§impl PendingRequest
impl PendingRequest
Sourcepub fn new(
id: impl Into<String>,
actor: Subject,
mutation: Mutation,
requested_at: u64,
) -> Self
pub fn new( id: impl Into<String>, actor: Subject, mutation: Mutation, requested_at: u64, ) -> Self
A pending request with no expiry and no impact.
pub fn expiring_at(self, expires_at: Option<u64>) -> Self
pub fn with_status(self, status: PendingStatus) -> Self
pub fn with_impact(self, impact: Impact) -> Self
pub fn with_elevation(self, elevation: ElevationInfo) -> Self
pub fn is_pending(&self) -> bool
pub fn is_due(&self, now: u64) -> bool
Trait Implementations§
Source§impl Clone for PendingRequest
impl Clone for PendingRequest
Source§impl Debug for PendingRequest
impl Debug for PendingRequest
Source§impl<'de> Deserialize<'de> for PendingRequest
impl<'de> Deserialize<'de> for PendingRequest
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PendingRequest
impl PartialEq for PendingRequest
Source§impl Serialize for PendingRequest
impl Serialize for PendingRequest
impl StructuralPartialEq for PendingRequest
Auto Trait Implementations§
impl Forget for PendingRequest
impl Freeze for PendingRequestwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<RoleAssignment>: Freeze,
PhantomData<String>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<Condition>: Freeze,
*const Condition is !null: Freeze,
PhantomData<Operand>: Freeze,
PhantomData<AccessChange>: Freeze,
PhantomData<PotentialClash>: Freeze,
impl Move for PendingRequest
impl RefUnwindSafe for PendingRequest
impl Send for PendingRequest
impl Sync for PendingRequest
impl Unpin for PendingRequest
impl UnsafeUnpin for PendingRequestwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<RoleAssignment>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<Condition>: UnsafeUnpin,
*const Condition is !null: UnsafeUnpin,
PhantomData<Operand>: UnsafeUnpin,
PhantomData<AccessChange>: UnsafeUnpin,
PhantomData<PotentialClash>: UnsafeUnpin,
impl UnwindSafe for PendingRequest
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
Mutably borrows from an owned value. Read more