Skip to main content

TransferCompleteNotification

Struct TransferCompleteNotification 

Source
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

Source

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.

Source

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.

Source

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.

Source

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 aggregate
  • events - The event system to create the aggregate event
  • runtime - 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§

Source§

impl IntoFuture for TransferCompleteNotification

Source§

type Output = Result<(), Error>

The output that the future will produce on completion.
Source§

type IntoFuture = Either<Ready<Result<(), Error>>, TransferAwaiter>

Which kind of future are we turning this into?
Source§

fn into_future(self) -> Self::IntoFuture

Creates a future from a value. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more