pub enum Endpoint {
Tcp(SocketAddr),
Ipc(PathBuf),
Inproc(String),
}Expand description
Transport endpoint address.
Variants§
Tcp(SocketAddr)
TCP transport: tcp://host:port
Ipc(PathBuf)
IPC transport (Unix domain socket): ipc:///path/to/socket
Inproc(String)
In-process transport: inproc://name
Implementations§
Source§impl Endpoint
impl Endpoint
Sourcepub fn parse(s: &str) -> Result<Self, EndpointError>
pub fn parse(s: &str) -> Result<Self, EndpointError>
Parse an endpoint from a string.
Supported formats:
tcp://127.0.0.1:5555tcp://[::1]:5555(IPv6)ipc:///tmp/socket.sock(Unix only)inproc://name
§Examples
use monocoque_core::endpoint::Endpoint;
let endpoint = Endpoint::parse("tcp://127.0.0.1:5555").unwrap();
assert!(matches!(endpoint, Endpoint::Tcp(_)));
let endpoint = Endpoint::parse("ipc:///tmp/test.sock").unwrap();
assert!(matches!(endpoint, Endpoint::Ipc(_)));
let endpoint = Endpoint::parse("inproc://my-endpoint").unwrap();
assert!(matches!(endpoint, Endpoint::Inproc(_)));Trait Implementations§
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 UnsafeUnpin 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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more