Skip to main content

Configuration

Struct Configuration 

Source
pub struct Configuration {
    pub shutdown: Box<dyn Shutdown>,
    pub timeout: Option<Duration>,
}
Expand description

Configuration for produce method.

Fields§

§shutdown: Box<dyn Shutdown>

When this future resolves producers stops producing and returns.

NOTE: By default it is set with futures::future::Pending, but it doesn’t mean producer will never stop - it will still stop when transport is closed, or it can be stopped by provided send_error_callback or receive_error_callback.

This future is intended for triggering shutdown manually.

§timeout: Option<Duration>

Optional duration after which producer will shutdown if it will not receive any messages during that period (and there are no requests pending).

NOTE: It resets on every message received - so a producer that has received messages in the past can still time out when a period of duration length with no further messages occurs.

Trait Implementations§

Source§

impl Default for Configuration

Source§

fn default() -> Self

Returns the “default value” for a type. 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<T> ConditionalSend for T
where T: Send,

Source§

impl<T> Error for T
where T: ConditionalSend + 'static,

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> TransportError for T
where T: ConditionalSend + 'static,

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.