pub enum PingUploadTask {
    Upload {
        request: PingRequest,
    },
    Wait {
        time: u64,
    },
    Done { /* private fields */ },
}
Expand description

An enum representing the possible upload tasks to be performed by an uploader.

When asking for the next ping request to upload, the requester may receive one out of three possible tasks.

Variants§

§

Upload

Fields

§request: PingRequest

The ping request for upload See PingRequest for more information.

An upload task

§

Wait

Fields

§time: u64

The time in milliseconds the requester should wait before requesting a new task.

A flag signaling that the pending pings directories are not done being processed, thus the requester should wait and come back later.

§

Done

Fields

A flag signaling that requester doesn’t need to request any more upload tasks at this moment.

There are three possibilities for this scenario:

  • Pending pings queue is empty, no more pings to request;
  • Requester has gotten more than MAX_WAIT_ATTEMPTS (3, by default) PingUploadTask::Wait responses in a row;
  • Requester has reported more than MAX_RECOVERABLE_FAILURES_PER_UPLOADING_WINDOW recoverable upload failures on the same uploading window (see below) and should stop requesting at this moment.

An “uploading window” starts when a requester gets a new PingUploadTask::Upload(PingRequest) response and finishes when they finally get a PingUploadTask::Done or PingUploadTask::Wait response.

Implementations§

Whether the current task is an upload task.

Whether the current task is wait task.

Trait Implementations§

Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Create a new handle for an Arc value Read more
Clone a handle Read more
Consume a handle, getting back the initial Arc<>
Get a clone of the Arc<> using a “borrowed” handle. Read more

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.