pub trait ExecutionGuard {
type Error: Error + Send + Sync + 'static;
// Required methods
fn acquire(
&self,
slot: ExecutionSlot,
) -> impl Future<Output = Result<ExecutionGuardAcquire, Self::Error>> + Send;
fn renew(
&self,
lease: &ExecutionLease,
) -> impl Future<Output = Result<ExecutionGuardRenewal, Self::Error>> + Send;
fn release(
&self,
lease: &ExecutionLease,
) -> impl Future<Output = Result<(), Self::Error>> + Send;
// Provided methods
fn classify_error(_error: &Self::Error) -> ExecutionGuardErrorKind
where Self: Sized { ... }
fn renew_interval(&self, _lease: &ExecutionLease) -> Option<Duration> { ... }
}Required Associated Types§
Required Methods§
fn acquire( &self, slot: ExecutionSlot, ) -> impl Future<Output = Result<ExecutionGuardAcquire, Self::Error>> + Send
fn renew( &self, lease: &ExecutionLease, ) -> impl Future<Output = Result<ExecutionGuardRenewal, Self::Error>> + Send
fn release( &self, lease: &ExecutionLease, ) -> impl Future<Output = Result<(), Self::Error>> + Send
Provided Methods§
fn classify_error(_error: &Self::Error) -> ExecutionGuardErrorKindwhere
Self: Sized,
fn renew_interval(&self, _lease: &ExecutionLease) -> Option<Duration>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.