pub enum Binding {
FileDescriptor(i32),
FilePath(PathBuf),
Sockets(Vec<SocketAddr>),
NamedPipe(OsString),
}
Expand description
Service binding.
Indicates which mechanism should the service take to bind its listener to.
§Examples
Note that since the tcp
protocol can use an address the Sockets
binding will contain all IP addresses that the address resolves to.
let binding = "tcp://127.0.0.1:8080".try_into()?;
assert_eq!(
Binding::Sockets(vec![([127, 0, 0, 1], 8080).into()]),
binding
);
Variants§
FileDescriptor(i32)
The service should be bound to this explicit, opened file descriptor. This mechanism is used by the socket activation.
FilePath(PathBuf)
The service should be bound to a Unix domain socket file under specified path.
Sockets(Vec<SocketAddr>)
The service should be bound to the first TCP socket that succeed the binding.
NamedPipe(OsString)
Windows Named Pipe.
Trait Implementations§
Source§impl From<SocketAddr> for Binding
impl From<SocketAddr> for Binding
Source§fn from(value: SocketAddr) -> Self
fn from(value: SocketAddr) -> Self
Converts to this type from the input type.
impl Eq for Binding
impl StructuralPartialEq for Binding
Auto Trait Implementations§
impl Freeze for Binding
impl RefUnwindSafe for Binding
impl Send for Binding
impl Sync for Binding
impl Unpin for Binding
impl UnwindSafe for Binding
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