Struct tokio_zmq::socket::config::SockConfig[][src]

pub struct SockConfig<'a> {
    pub ctx: Arc<Context>,
    pub bind: Vec<&'a str>,
    pub connect: Vec<&'a str>,
    pub identity: Option<&'a [u8]>,
}

The final builder step for some socket types

This contains all the information required to contstruct a valid socket, except in the case of SUB, which needs an additional filter parameter.

Fields

Methods

impl<'a> SockConfig<'a>
[src]

Bind the SockConfig to an address, returning a SockConfig

This allows for a single socket to be bound to multiple addresses.

Connect the SockConfig to an address, returning a SockConfig

This allows for a single socket to be connected to multiple addresses.

Finalize the SockConfig into a Socket if the creation is successful, or into an Error if something went wrong.

Since we can't dynamically create different wrapper types (Rep, Req, Pub, etc.), we just create the inner Socket, and expect this function to be called in a few contexts

  • The caller is a wrapper type.
  • The caller knows what they're doing.

For convenience, TryFrom<SockConfig> is implemented for all valid wrapper types.

Continue the building process into a SubConfig, for the SUB socket type which requires setting a subscription filter.

Trait Implementations

impl<'a> TryFrom<SockConfig<'a>> for Dealer
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<'a> TryFrom<SockConfig<'a>> for Pub
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<'a> TryFrom<SockConfig<'a>> for Pull
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<'a> TryFrom<SockConfig<'a>> for Push
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<'a> TryFrom<SockConfig<'a>> for Rep
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<'a> TryFrom<SockConfig<'a>> for Req
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<'a> TryFrom<SockConfig<'a>> for Router
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<'a> TryFrom<SockConfig<'a>> for Xpub
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<'a> TryFrom<SockConfig<'a>> for Xsub
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

Auto Trait Implementations

impl<'a> Send for SockConfig<'a>

impl<'a> Sync for SockConfig<'a>