[][src]Struct rants::Connect

pub struct Connect { /* fields omitted */ }

The CONNECT message sent by the client

Methods

impl Connect[src]

pub fn new() -> Self[src]

Construct a new default Connect

pub fn is_verbose(&self) -> bool[src]

Return true if the connection is verbose.

pub fn verbose(&mut self, verbose: bool) -> &mut Self[src]

Turns on +OK protocol acknowledgements. [default = false]

pub fn is_pedantic(&self) -> bool[src]

Return true if the connection is pedantic.

pub fn pedantic(&mut self, pedantic: bool) -> &mut Self[src]

Turns on additional strict format checking, e.g. for properly formed subjects [default = false]

pub fn is_tls_required(&self) -> bool[src]

Return true if the connection requires TLS.

pub fn tls_required(&mut self, tls_required: bool) -> &mut Self[src]

Indicates whether the client requires an SSL connection. [default = false]

pub fn authorization(&self) -> Option<&Authorization>[src]

Get the Authorization

pub fn token(&mut self, token: String) -> &mut Self[src]

Set the authorization to use a token

pub fn username_password(
    &mut self,
    username: String,
    password: String
) -> &mut Self
[src]

Set the authorization to use a username and password

pub fn set_authorization(
    &mut self,
    authorization: Option<Authorization>
) -> &mut Self
[src]

Set the authorization

pub fn clear_authorization(&mut self) -> &mut Self[src]

Remove the authorization

pub fn get_name(&self) -> Option<&str>[src]

Get the optional name of the client.

pub fn name(&mut self, name: String) -> &mut Self[src]

Set the optional client name. [default = None]

pub fn clear_name(&mut self) -> &mut Self[src]

Remove the optional client name [default = None]

pub fn get_lang(&self) -> &str[src]

The implementation language of the client. [always = "rust"]

pub fn get_version(&self) -> &str[src]

The version of the client. [always = "<the crate version>"]

pub fn get_protocol(&self) -> i32[src]

Optional int. Sending 0 (or absent) indicates client supports original protocol. Sending 1 indicates that the client supports dynamic reconfiguration of cluster topology changes by asynchronously receiving INFO messages with known servers it can reconnect to. [always = 1]

pub fn is_echo(&self) -> bool[src]

Return true if echo is enabled on the connection.

pub fn echo(&mut self, echo: bool) -> &mut Self[src]

Optional boolean. If set to true, the server (version 1.2.0+) will send originating messages from this connection to its own subscriptions. Clients should set this to true only for server supporting this feature, which is when proto in the INFO protocol is set to at least 1 [default = false]

Trait Implementations

impl Clone for Connect[src]

impl Debug for Connect[src]

impl Default for Connect[src]

impl PartialEq<Connect> for Connect[src]

impl Serialize for Connect[src]

impl StructuralPartialEq for Connect[src]

Auto Trait Implementations

impl RefUnwindSafe for Connect

impl Send for Connect

impl Sync for Connect

impl Unpin for Connect

impl UnwindSafe for Connect

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,