Trait Poller

Source
pub trait Poller<ResponseType, MetadataType>: Send + Poller {
    // Required methods
    fn poll(
        &mut self,
    ) -> impl Future<Output = Option<PollingResult<ResponseType, MetadataType>>> + Send;
    fn until_done(self) -> impl Future<Output = Result<ResponseType>> + Send;
    fn into_stream(
        self,
    ) -> impl Stream<Item = PollingResult<ResponseType, MetadataType>> + Unpin;
}
Expand description

Automatically polls long-running operations.

§Parameters

  • ResponseType - This is the type returned when the LRO completes successfully.
  • MetadataType - The LRO may return values of this type while the operation is in progress. This may include some measure of “progress”.

Required Methods§

Source

fn poll( &mut self, ) -> impl Future<Output = Option<PollingResult<ResponseType, MetadataType>>> + Send

Query the current status of the long-running operation.

Source

fn until_done(self) -> impl Future<Output = Result<ResponseType>> + Send

Poll the long-running operation until it completes.

Source

fn into_stream( self, ) -> impl Stream<Item = PollingResult<ResponseType, MetadataType>> + Unpin

Available on crate feature unstable-stream only.

Convert a poller to a Stream.

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.

Implementors§