pub struct TransferCompleteNotification { /* private fields */ }Expand description
Notification handle for an in-progress transfer.
This object can be awaited to block until the transfer completes. The transfer is tracked by a background handler that polls for completion or processes notification events.
Uses futures::Either to avoid event system overhead for synchronous completions.
Pending transfers use LocalEventWaiter which avoids heap allocation and repeated
DashMap lookups when awaiting.
Implementations§
Source§impl TransferCompleteNotification
impl TransferCompleteNotification
Sourcepub fn completed() -> Self
pub fn completed() -> Self
Create a notification that is already completed (for synchronous transfers).
This is useful for transfers that complete immediately without needing background polling, such as memcpy operations.
This is extremely efficient - no allocations, locks, or event system overhead.
Sourcepub fn from_awaiter(awaiter: EventAwaiter) -> Self
pub fn from_awaiter(awaiter: EventAwaiter) -> Self
Create a notification from a LocalEventWaiter.
This is the primary way to construct a notification when you already have an event waiter from the event system.
Sourcepub fn could_yield(&self) -> bool
pub fn could_yield(&self) -> bool
Check if the notification can yield the current task.
The internal ::Left arm is guaranteed to be ready, while the ::Right arm is not.
Sourcepub fn aggregate(
notifications: Vec<Self>,
events: &Arc<EventManager>,
runtime: &Handle,
) -> Result<Self>
pub fn aggregate( notifications: Vec<Self>, events: &Arc<EventManager>, runtime: &Handle, ) -> Result<Self>
Aggregate multiple notifications into one that completes when all are done.
This is useful when a transfer is split across multiple workers and you want to wait for all of them to complete.
§Arguments
notifications- The notifications to aggregateevents- The event system to create the aggregate eventruntime- The tokio runtime handle to spawn the aggregation task
§Behavior
- If the list is empty, returns an already-completed notification
- If there’s only one, returns it directly
- Otherwise, creates a new event and spawns a task to await all notifications
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TransferCompleteNotification
impl !UnwindSafe for TransferCompleteNotification
impl Freeze for TransferCompleteNotification
impl Send for TransferCompleteNotification
impl Sync for TransferCompleteNotification
impl Unpin for TransferCompleteNotification
impl UnsafeUnpin for TransferCompleteNotification
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
T in a tonic::Request