Skip to main content

Call

Struct Call 

Source
pub struct Call {
    pub method: &'static str,
    pub path: String,
    pub query: Vec<(String, String)>,
    pub body: Vec<u8>,
    pub headers: Vec<(String, String)>,
    pub content_type: Option<String>,
    pub request_id: Option<String>,
    pub traceparent: Option<String>,
    pub timeout: Option<Duration>,
    pub retry_gateway: bool,
    pub recover: Vec<(u16, &'static str)>,
}
Expand description

A call to the API, before it becomes HTTP.

Fields§

§method: &'static str§path: String

Path with the segments already encoded (/topics/orders).

§query: Vec<(String, String)>§body: Vec<u8>§headers: Vec<(String, String)>

Only applies with a body; default application/json. Extra headers (an Accept of its own replaces the default application/json).

§content_type: Option<String>§request_id: Option<String>§traceparent: Option<String>§timeout: Option<Duration>

Overrides the total time of the call (consume uses waitTime + 10 s).

§retry_gateway: bool

Retries 502 and 504: only publishing to a FIFO queue, where the primary deduplicates.

§recover: Vec<(u16, &'static str)>

After a 503, these responses count as success (the operation had already been applied): creating a topic (409 topic.already-exists) and deleting (404).

Implementations§

Source§

impl Call

Source

pub fn new(method: &'static str, path: impl Into<String>) -> Call

Source

pub fn query(self, key: &str, value: impl ToString) -> Call

Source

pub fn json_body(self, body: String) -> Call

Trait Implementations§

Source§

impl Clone for Call

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Call

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Call

§

impl RefUnwindSafe for Call

§

impl Send for Call

§

impl Sync for Call

§

impl Unpin for Call

§

impl UnsafeUnpin for Call

§

impl UnwindSafe for Call

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.