Struct ntex_amqp::Configuration

source ·
pub struct Configuration {
    pub max_frame_size: u32,
    pub channel_max: u16,
    pub idle_time_out: Milliseconds,
    pub hostname: Option<ByteString>,
    /* private fields */
}
Expand description

Amqp1 transport configuration.

Fields§

§max_frame_size: u32§channel_max: u16§idle_time_out: Milliseconds§hostname: Option<ByteString>

Implementations§

source§

impl Configuration

source

pub fn new() -> Self

Create connection configuration.

source

pub fn channel_max(&mut self, num: u16) -> &mut Self

The channel-max value is the highest channel number that may be used on the Connection. This value plus one is the maximum number of Sessions that can be simultaneously active on the Connection.

By default channel max value is set to 1024

source

pub fn max_frame_size(&mut self, size: u32) -> &mut Self

Set max frame size for the connection.

By default max size is set to 64kb

source

pub fn get_max_frame_size(&self) -> u32

Get max frame size for the connection.

source

pub fn idle_timeout(&mut self, timeout: u16) -> &mut Self

Set idle time-out for the connection in seconds.

By default idle time-out is set to 120 seconds

source

pub fn hostname(&mut self, hostname: &str) -> &mut Self

Set connection hostname

Hostname is not set by default

source

pub fn max_size(&mut self, size: usize) -> &mut Self

Set max inbound frame size.

If max size is set to 0, size is unlimited. By default max size is set to 0

source

pub fn handshake_timeout(&mut self, timeout: Seconds) -> &mut Self

Set handshake timeout.

By default handshake timeout is 5 seconds.

source

pub fn keepalive_timeout(&mut self, val: Seconds) -> &mut Self

Set server connection keep-alive timeout.

To disable timeout set value to 0.

By default keep-alive timeout is disabled.

source

pub fn disconnect_timeout(&mut self, val: Seconds) -> &mut Self

Set server connection disconnect timeout.

Defines a timeout for disconnect connection. If a disconnect procedure does not complete within this time, the connection get dropped.

To disable timeout set value to 0.

By default disconnect timeout is set to 3 seconds.

source

pub fn frame_read_rate( &mut self, timeout: Seconds, max_timeout: Seconds, rate: u16 ) -> &mut Self

Set read rate parameters for single frame.

Set read timeout, max timeout and rate for reading payload. If the client sends rate amount of data within timeout period of time, extend timeout by timeout seconds. But no more than max_timeout timeout.

By default frame read rate is disabled.

source

pub fn to_open(&self) -> Open

Create Open performative for this configuration.

source

pub fn from_remote(&self, open: &Open) -> Configuration

Trait Implementations§

source§

impl Clone for Configuration

source§

fn clone(&self) -> Configuration

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Configuration

source§

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

Formats the value using the given formatter. Read more
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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more