pub struct CallbackService { /* private fields */ }Expand description
Bounded, runtime-owned completion callback executor.
Implementations§
Source§impl CallbackService
impl CallbackService
Sourcepub fn new(
max_concurrent: usize,
default_deadline: Duration,
executor: Handle,
) -> Self
pub fn new( max_concurrent: usize, default_deadline: Duration, executor: Handle, ) -> Self
Create with a maximum number of concurrent callback tasks.
Sourcepub fn try_reserve(&self) -> Option<CallbackReservation>
pub fn try_reserve(&self) -> Option<CallbackReservation>
Reserve one callback slot at admission (fail closed when full).
Sourcepub fn schedule_reserved(
&self,
reservation: CallbackReservation,
callback: Box<dyn CompletionCallback>,
end: TransactionEnd,
deadline: Option<Duration>,
)
pub fn schedule_reserved( &self, reservation: CallbackReservation, callback: Box<dyn CompletionCallback>, end: TransactionEnd, deadline: Option<Duration>, )
Schedule a host callback using an admission reservation (D-029).
If the executor rejects the spawn, the reservation permit is dropped and inflight is not left elevated (D-032).
Sourcepub fn schedule(
&self,
callback: Box<dyn CompletionCallback>,
end: TransactionEnd,
deadline: Option<Duration>,
)
pub fn schedule( &self, callback: Box<dyn CompletionCallback>, end: TransactionEnd, deadline: Option<Duration>, )
Schedule a host callback on an owned task (does not block the caller).
Prefer [schedule_reserved] after admission. This path still acquires a
permit before work; if none are available the callback is dropped fail-closed.
Trait Implementations§
Source§impl Clone for CallbackService
impl Clone for CallbackService
Source§fn clone(&self) -> CallbackService
fn clone(&self) -> CallbackService
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for CallbackService
impl !UnwindSafe for CallbackService
impl Freeze for CallbackService
impl Send for CallbackService
impl Sync for CallbackService
impl Unpin for CallbackService
impl UnsafeUnpin for CallbackService
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