Struct Socket

Source
pub struct Socket { /* private fields */ }
Expand description

Defines the raw Socket type. This type should never be interacted with directly, except to create new instances of wrapper types.

Implementations§

Source§

impl Socket

Source

pub fn builder<T>(ctx: Arc<Context>) -> SocketBuilder<'static, T>
where T: IntoInnerSocket,

Start a new Socket Config builder

Source

pub fn inner(self) -> SockId

Retrieve a Reference-Counted Pointer to self’s socket.

Source

pub fn from_sock_and_session(sock: SockId, session: LocalSession) -> Self

Create a new socket from a given Sock and File

This assumes that sock is already configured properly. Please don’t call this directly unless you know what you’re doing.

Trait Implementations§

Source§

impl Debug for Socket

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for Socket

Source§

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

Formats the value using the given formatter. Read more
Source§

impl From<(SockId, LocalSession)> for Socket

Source§

fn from((sock, session): (SockId, LocalSession)) -> Self

Converts to this type from the input type.
Source§

impl From<Socket> for Dealer

Source§

fn from(inner: Socket) -> Self

Converts to this type from the input type.
Source§

impl From<Socket> for Pair

Source§

fn from(inner: Socket) -> Self

Converts to this type from the input type.
Source§

impl From<Socket> for Pub

Source§

fn from(inner: Socket) -> Self

Converts to this type from the input type.
Source§

impl From<Socket> for Pull

Source§

fn from(inner: Socket) -> Self

Converts to this type from the input type.
Source§

impl From<Socket> for Push

Source§

fn from(inner: Socket) -> Self

Converts to this type from the input type.
Source§

impl From<Socket> for Rep

Source§

fn from(inner: Socket) -> Self

Converts to this type from the input type.
Source§

impl From<Socket> for Req

Source§

fn from(inner: Socket) -> Self

Converts to this type from the input type.
Source§

impl From<Socket> for Router

Source§

fn from(inner: Socket) -> Self

Converts to this type from the input type.
Source§

impl From<Socket> for Sub

Source§

fn from(inner: Socket) -> Self

Converts to this type from the input type.
Source§

impl From<Socket> for Xpub

Source§

fn from(inner: Socket) -> Self

Converts to this type from the input type.
Source§

impl From<Socket> for Xsub

Source§

fn from(inner: Socket) -> Self

Converts to this type from the input type.
Source§

impl<T> InnerSocket<T> for Socket
where T: IntoInnerSocket + From<Self>,

Source§

type Request = MultipartRequest<T>

The future that sends a multipart to a ZMQ socket
Source§

type Response = MultipartResponse<T>

The future that receives a multipart from a ZMQ socket
Source§

type Sink = MultipartSink<T>

A Sink that sends multiparts to a ZMQ socket
Source§

type Stream = MultipartStream<T>

A Stream of multiparts received from a ZMQ socket
Source§

type SinkStream = MultipartSinkStream<T>

A Sink and Stream that sends and receives multiparts from a ZMQ socket
Source§

fn send(self, multipart: Multipart) -> Self::Request

Source§

fn recv(self) -> Self::Response

Source§

fn stream(self) -> Self::Stream

Source§

fn sink(self, buffer_size: usize) -> Self::Sink

Source§

fn sink_stream(self, buffer_size: usize) -> Self::SinkStream

Source§

impl<T> IntoSocket<T, Socket> for MultipartSink<T>
where T: From<Socket>,

Source§

fn into_socket(self) -> T

Source§

impl<T> IntoSocket<T, Socket> for MultipartSinkStream<T>
where T: From<Socket>,

Source§

fn into_socket(self) -> T

Source§

impl<T> IntoSocket<T, Socket> for MultipartStream<T>
where T: From<Socket>,

Source§

fn into_socket(self) -> T

Auto Trait Implementations§

§

impl Freeze for Socket

§

impl RefUnwindSafe for Socket

§

impl Send for Socket

§

impl Sync for Socket

§

impl Unpin for Socket

§

impl UnwindSafe for Socket

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, 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.