pub struct RevocationRequest {
pub task_id: Uuid,
pub mode: RevocationMode,
pub timestamp: f64,
pub expires: Option<f64>,
pub reason: Option<String>,
pub signal: Option<String>,
}Expand description
A request to revoke a task
Fields§
§task_id: UuidTask ID to revoke
mode: RevocationModeRevocation mode
timestamp: f64When the revocation was issued (Unix timestamp)
expires: Option<f64>Optional expiration time (Unix timestamp)
reason: Option<String>Reason for revocation
signal: Option<String>Signal to send (for terminate mode)
Implementations§
Source§impl RevocationRequest
impl RevocationRequest
Sourcepub fn new(task_id: Uuid, mode: RevocationMode) -> Self
pub fn new(task_id: Uuid, mode: RevocationMode) -> Self
Create a new revocation request
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 with_signal(self, signal: impl Into<String>) -> Self
pub fn with_signal(self, signal: impl Into<String>) -> Self
Set signal to send (for terminate mode)
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if this revocation has expired
Trait Implementations§
Source§impl Clone for RevocationRequest
impl Clone for RevocationRequest
Source§fn clone(&self) -> RevocationRequest
fn clone(&self) -> RevocationRequest
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 RevocationRequest
impl Debug for RevocationRequest
Source§impl<'de> Deserialize<'de> for RevocationRequest
impl<'de> Deserialize<'de> for RevocationRequest
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
Auto Trait Implementations§
impl Freeze for RevocationRequest
impl RefUnwindSafe for RevocationRequest
impl Send for RevocationRequest
impl Sync for RevocationRequest
impl Unpin for RevocationRequest
impl UnwindSafe for RevocationRequest
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