Skip to main content

PendingRequest

Struct PendingRequest 

Source
#[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: Subject

Whoever proposed the change. The invariants judge the change as this actor, at proposal and at approval.

§mutation: Mutation§requested_at: u64

Milliseconds 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

Source

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

Source

pub fn new( id: impl Into<String>, actor: Subject, mutation: Mutation, requested_at: u64, ) -> Self

A pending request with no expiry and no impact.

Source

pub fn expiring_at(self, expires_at: Option<u64>) -> Self

Source

pub fn with_status(self, status: PendingStatus) -> Self

Source

pub fn with_impact(self, impact: Impact) -> Self

Source

pub fn with_elevation(self, elevation: ElevationInfo) -> Self

Source

pub fn is_pending(&self) -> bool

Source

pub fn is_due(&self, now: u64) -> bool

Source

pub fn target(&self) -> String

Grant id, or role@subject (role#scope@subject with a scope) for a role change.

Trait Implementations§

Source§

impl Clone for PendingRequest

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PendingRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PendingRequest

Source§

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

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for PendingRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for PendingRequest

Auto Trait Implementations§

§

impl Forget for PendingRequest

§

impl Freeze for PendingRequest

§

impl Move for PendingRequest

§

impl RefUnwindSafe for PendingRequest

§

impl Send for PendingRequest
where RawVecInner: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send, BoxRaw<Condition>: Send,

§

impl Sync for PendingRequest
where RawVecInner: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync, BoxRaw<Condition>: Sync,

§

impl Unpin for PendingRequest
where *const u8 is !null: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin, Box<Condition>: Unpin,

§

impl UnsafeUnpin for PendingRequest

§

impl UnwindSafe for PendingRequest
where RawVecInner: UnwindSafe, BTreeMap<String, Value>: UnwindSafe, BoxRaw<Condition>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.