pub struct RoutingId(pub u32);
Expand description
A generated ID used to route messages to the approriate client.
A RoutingId
is an unique temporary identifier for each Client
connection on a Server
socket generated by ØMQ.
§Example
use libzmq::{prelude::*, *};
let addr: TcpAddr = "127.0.0.1:*".try_into()?;
let server = ServerBuilder::new()
.bind(addr)
.build()?;
let bound = server.last_endpoint()?;
let client = ClientBuilder::new()
.connect(bound)
.build()?;
// The client initiates the conversation.
client.send("")?;
// ØMQ generates a `RoutingId` for the client upon reception of the
// first message.
let msg = server.recv_msg()?;
let id = msg.routing_id().unwrap();
// This `RoutingId` is used to route messages back to the `Client`.
server.route("", id)?;
Tuple Fields§
§0: u32
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RoutingId
impl<'de> Deserialize<'de> for RoutingId
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for RoutingId
impl Eq for RoutingId
impl StructuralPartialEq for RoutingId
Auto Trait Implementations§
impl Freeze for RoutingId
impl RefUnwindSafe for RoutingId
impl Send for RoutingId
impl Sync for RoutingId
impl Unpin for RoutingId
impl UnwindSafe for RoutingId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more