pub struct Pipeline { /* private fields */ }
Expand description

Execution pipeline.

A pipeline follows a precise flow:

  1. Client library-specified per-call policies are executed. Per-call policies can fail and bail out of the pipeline immediately.
  2. User-specified per-call policies are executed.
  3. Telemetry policy.
  4. Retry policy. It allows to re-execute the following policies.
  5. Client library-specified per-retry policies. Per-retry polices are always executed at least once but are re-executed in case of retries.
  6. User-specified per-retry policies are executed.
  7. Authorization policy. Authorization can depend on the HTTP headers and/or the request body so it must be executed right before sending the request to the transport. Also, the authorization can depend on the current time so it must be executed at every retry.
  8. Transport policy. Transport policy is always the last policy and is the policy that actually constructs the Response to be passed up the pipeline.

A pipeline is immutable. In other words a policy can either succeed and call the following policy of fail and return to the calling policy. Arbitrary policy “skip” must be avoided (but cannot be enforced by code). All policies except Transport policy can assume there is another following policy (so self.pipeline[0] is always valid).

The C generic contains the pipeline-specific context. Different crates can pass different contexts using this generic. This way each crate can have its own specific pipeline context. For example, in CosmosDB, the generic carries the operation-specific information used by the authorization policy.

Implementations

Creates a new pipeline given the client library crate name and version, alone with user-specified and client library-specified policies.

Crates can simply pass option_env!("CARGO_PKG_NAME") and option_env!("CARGO_PKG_VERSION") for the crate_name and crate_version arguments respectively.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. 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.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.