Struct SessionBuilder

Source
pub struct SessionBuilder<Host, Vpn, Username, Password, OnMessage, OnEvent> { /* private fields */ }
Expand description

SessionBuilder allows setting up a session with customizable options that are not exposed by the session function such as buffer size, timeouts, and more.

For more detailed documentation on all the configuration field, refer to the official library documentation.

Implementations§

Source§

impl<'session, Host, Vpn, Username, Password, OnMessage, OnEvent> SessionBuilder<Host, Vpn, Username, Password, OnMessage, OnEvent>
where Host: Into<Vec<u8>>, Vpn: Into<Vec<u8>>, Username: Into<Vec<u8>>, Password: Into<Vec<u8>>, OnMessage: FnMut(InboundMessage) + Send + 'session, OnEvent: FnMut(SessionEvent) + Send + 'session,

Source

pub fn build( self, ) -> Result<Session<'session, OnMessage, OnEvent>, SessionBuilderError>

Source

pub fn host_name(self, host_name: Host) -> Self

Source

pub fn vpn_name(self, vpn_name: Vpn) -> Self

Source

pub fn username(self, username: Username) -> Self

Source

pub fn password(self, password: Password) -> Self

Source

pub fn on_message(self, on_message: OnMessage) -> Self

Source

pub fn on_event(self, on_event: OnEvent) -> Self

Source

pub fn buffer_size_bytes(self, buffer_size_bytes: u64) -> Self

Source

pub fn block_write_timeout_ms(self, write_timeout_ms: u64) -> Self

Source

pub fn connect_timeout_ms(self, connect_timeout_ms: u64) -> Self

Source

pub fn subconfirm_timeout_ms(self, subconfirm_timeout_ms: u64) -> Self

Source

pub fn ignore_dup_subscription_error( self, ignore_dup_subscription_error: bool, ) -> Self

Source

pub fn tcp_nodelay(self, tcp_nodelay: bool) -> Self

Source

pub fn socket_send_buf_size_bytes(self, socket_send_buf_size_bytes: u64) -> Self

Source

pub fn socket_rcv_buf_size_bytes(self, socket_rcv_buf_size_bytes: u64) -> Self

Source

pub fn keep_alive_interval_ms(self, keep_alive_interval_ms: u64) -> Self

Source

pub fn keep_alive_limit(self, keep_alive_limit: u64) -> Self

Source

pub fn application_description<AppDescription: Into<Vec<u8>>>( self, application_description: AppDescription, ) -> Self

Source

pub fn client_name<ClientName: Into<Vec<u8>>>( self, client_name: ClientName, ) -> Self

Source

pub fn compression_level(self, compression_level: u8) -> Self

Source

pub fn generate_rcv_timestamps(self, generate_rcv_timestamps: bool) -> Self

Source

pub fn generate_send_timestamp(self, generate_send_timestamp: bool) -> Self

Source

pub fn generate_sender_id(self, generate_sender_id: bool) -> Self

Source

pub fn generate_sender_sequence_number( self, generate_sender_sequence_number: bool, ) -> Self

Source

pub fn connect_retries_per_host(self, connect_retries_per_host: i64) -> Self

Source

pub fn connect_retries(self, connect_retries: i64) -> Self

Source

pub fn reconnect_retries(self, reconnect_retries: i64) -> Self

Source

pub fn reconnect_retry_wait_ms(self, reconnect_retry_wait_ms: u64) -> Self

Source

pub fn reapply_subscriptions(self, reapply_subscriptions: bool) -> Self

Source

pub fn provision_timeout_ms(self, provision_timeout_ms: u64) -> Self

Source

pub fn calculate_message_expiration( self, calculate_message_expiration: bool, ) -> Self

Source

pub fn no_local(self, no_local: bool) -> Self

Source

pub fn modifyprop_timeout_ms(self, modifyprop_timeout_ms: u64) -> Self

Source

pub fn ssl_trust_store_dir<ClientName: Into<Vec<u8>>>( self, ssl_trust_store_dir: ClientName, ) -> Self

Auto Trait Implementations§

§

impl<Host, Vpn, Username, Password, OnMessage, OnEvent> Freeze for SessionBuilder<Host, Vpn, Username, Password, OnMessage, OnEvent>
where OnMessage: Freeze, OnEvent: Freeze, Host: Freeze, Vpn: Freeze, Username: Freeze, Password: Freeze,

§

impl<Host, Vpn, Username, Password, OnMessage, OnEvent> RefUnwindSafe for SessionBuilder<Host, Vpn, Username, Password, OnMessage, OnEvent>
where OnMessage: RefUnwindSafe, OnEvent: RefUnwindSafe, Host: RefUnwindSafe, Vpn: RefUnwindSafe, Username: RefUnwindSafe, Password: RefUnwindSafe,

§

impl<Host, Vpn, Username, Password, OnMessage, OnEvent> Send for SessionBuilder<Host, Vpn, Username, Password, OnMessage, OnEvent>
where OnMessage: Send, OnEvent: Send, Host: Send, Vpn: Send, Username: Send, Password: Send,

§

impl<Host, Vpn, Username, Password, OnMessage, OnEvent> Sync for SessionBuilder<Host, Vpn, Username, Password, OnMessage, OnEvent>
where OnMessage: Sync, OnEvent: Sync, Host: Sync, Vpn: Sync, Username: Sync, Password: Sync,

§

impl<Host, Vpn, Username, Password, OnMessage, OnEvent> Unpin for SessionBuilder<Host, Vpn, Username, Password, OnMessage, OnEvent>
where OnMessage: Unpin, OnEvent: Unpin, Host: Unpin, Vpn: Unpin, Username: Unpin, Password: Unpin,

§

impl<Host, Vpn, Username, Password, OnMessage, OnEvent> UnwindSafe for SessionBuilder<Host, Vpn, Username, Password, OnMessage, OnEvent>
where OnMessage: UnwindSafe, OnEvent: UnwindSafe, Host: UnwindSafe, Vpn: UnwindSafe, Username: UnwindSafe, Password: UnwindSafe,

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