#[non_exhaustive]pub enum Endpoint {
Tcp(Host, u16),
Ipc(Option<PathBuf>),
}
Expand description
Represents a ZMQ Endpoint.
§Examples
assert_eq!(
"tcp://example.com:4567".parse::<Endpoint>()?,
Endpoint::Tcp(Host::Domain("example.com".to_string()), 4567)
);
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
source§impl Endpoint
impl Endpoint
pub fn transport(&self) -> Transport
sourcepub fn from_tcp_addr(addr: SocketAddr) -> Self
pub fn from_tcp_addr(addr: SocketAddr) -> Self
Creates an Endpoint::Tcp
from a SocketAddr
pub fn from_tcp_domain(addr: String, port: u16) -> Self
Trait Implementations§
source§impl TryIntoEndpoint for Endpoint
impl TryIntoEndpoint for Endpoint
impl Eq for Endpoint
impl StructuralPartialEq for Endpoint
Auto Trait Implementations§
impl Freeze for Endpoint
impl RefUnwindSafe for Endpoint
impl Send for Endpoint
impl Sync for Endpoint
impl Unpin for Endpoint
impl UnwindSafe for Endpoint
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)