pub struct PatternRevocation {
pub pattern: PatternMatcher,
pub mode: RevocationMode,
pub timestamp: f64,
pub expires: Option<f64>,
pub reason: Option<String>,
}Expand description
A pattern-based revocation rule
Fields§
§pattern: PatternMatcherPattern matcher for task names
mode: RevocationModeRevocation mode
timestamp: f64When the revocation was issued
expires: Option<f64>Optional expiration time
reason: Option<String>Reason for revocation
Implementations§
Source§impl PatternRevocation
impl PatternRevocation
Sourcepub fn new(pattern: PatternMatcher, mode: RevocationMode) -> Self
pub fn new(pattern: PatternMatcher, mode: RevocationMode) -> Self
Create a new pattern revocation
Sourcepub fn with_expiration(self, expires_in: Duration) -> Self
pub fn with_expiration(self, expires_in: Duration) -> Self
Set expiration time
Sourcepub fn with_reason(self, reason: impl Into<String>) -> Self
pub fn with_reason(self, reason: impl Into<String>) -> Self
Set reason for revocation
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if this revocation has expired
Trait Implementations§
Source§impl Clone for PatternRevocation
impl Clone for PatternRevocation
Source§fn clone(&self) -> PatternRevocation
fn clone(&self) -> PatternRevocation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PatternRevocation
impl Debug for PatternRevocation
Source§impl From<&PatternRevocation> for SerializablePatternRevocation
impl From<&PatternRevocation> for SerializablePatternRevocation
Source§fn from(rev: &PatternRevocation) -> Self
fn from(rev: &PatternRevocation) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PatternRevocation
impl RefUnwindSafe for PatternRevocation
impl Send for PatternRevocation
impl Sync for PatternRevocation
impl Unpin for PatternRevocation
impl UnwindSafe for PatternRevocation
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