pub struct PurgeInstanceFilter {
pub created_time_from: Option<DateTime<Utc>>,
pub created_time_to: Option<DateTime<Utc>>,
pub runtime_status: Vec<OrchestrationStatus>,
}Expand description
Filter criteria for bulk-purging orchestration instances.
Build using the provided builder methods, then pass to
TaskHubGrpcClient::purge_orchestrations_by_filter.
An empty filter matches all instances. Narrow the scope with
with_created_time_from,
with_created_time_to, and
with_runtime_status.
§Examples
use dapr_durabletask::api::{OrchestrationStatus, PurgeInstanceFilter};
let filter = PurgeInstanceFilter::new()
.with_created_time_from(chrono::Utc::now() - chrono::Duration::hours(24))
.with_runtime_status([OrchestrationStatus::Completed, OrchestrationStatus::Failed]);Fields§
§created_time_from: Option<DateTime<Utc>>Only purge instances created at or after this time.
created_time_to: Option<DateTime<Utc>>Only purge instances created before or at this time.
runtime_status: Vec<OrchestrationStatus>Only purge instances whose runtime status is in this list. An empty list matches all statuses.
Implementations§
Source§impl PurgeInstanceFilter
impl PurgeInstanceFilter
Sourcepub fn with_created_time_from(self, from: DateTime<Utc>) -> Self
pub fn with_created_time_from(self, from: DateTime<Utc>) -> Self
Only purge instances created at or after the given time.
Sourcepub fn with_created_time_to(self, to: DateTime<Utc>) -> Self
pub fn with_created_time_to(self, to: DateTime<Utc>) -> Self
Only purge instances created before or at the given time.
Sourcepub fn with_runtime_status(
self,
statuses: impl IntoIterator<Item = OrchestrationStatus>,
) -> Self
pub fn with_runtime_status( self, statuses: impl IntoIterator<Item = OrchestrationStatus>, ) -> Self
Only purge instances whose runtime status is in the provided list.
Trait Implementations§
Source§impl Clone for PurgeInstanceFilter
impl Clone for PurgeInstanceFilter
Source§fn clone(&self) -> PurgeInstanceFilter
fn clone(&self) -> PurgeInstanceFilter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PurgeInstanceFilter
impl Debug for PurgeInstanceFilter
Source§impl Default for PurgeInstanceFilter
impl Default for PurgeInstanceFilter
Source§fn default() -> PurgeInstanceFilter
fn default() -> PurgeInstanceFilter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PurgeInstanceFilter
impl RefUnwindSafe for PurgeInstanceFilter
impl Send for PurgeInstanceFilter
impl Sync for PurgeInstanceFilter
impl Unpin for PurgeInstanceFilter
impl UnsafeUnpin for PurgeInstanceFilter
impl UnwindSafe for PurgeInstanceFilter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request