pub struct BindingAddress { /* private fields */ }Expand description
A binding address combining socket address and protocol
Represents a complete socket binding specification including both the network address (IP + port) and the protocol (UDP or TCP). This ensures that socket address uniqueness validation accounts for protocol differences.
§Examples
use torrust_tracker_deployer_lib::domain::tracker::{BindingAddress, Protocol};
let udp_addr = BindingAddress::new(
"0.0.0.0:6969".parse().unwrap(),
Protocol::Udp
);
let tcp_addr = BindingAddress::new(
"0.0.0.0:7070".parse().unwrap(),
Protocol::Tcp
);
assert_eq!(udp_addr.socket().port(), 6969);
assert_eq!(tcp_addr.protocol(), Protocol::Tcp);Implementations§
Source§impl BindingAddress
impl BindingAddress
Sourcepub fn new(socket: SocketAddr, protocol: Protocol) -> Self
pub fn new(socket: SocketAddr, protocol: Protocol) -> Self
Creates a new binding address
§Examples
use torrust_tracker_deployer_lib::domain::tracker::{BindingAddress, Protocol};
let addr = BindingAddress::new(
"0.0.0.0:6969".parse().unwrap(),
Protocol::Udp
);Sourcepub fn socket(&self) -> &SocketAddr
pub fn socket(&self) -> &SocketAddr
Returns the socket address
Trait Implementations§
Source§impl Clone for BindingAddress
impl Clone for BindingAddress
impl Copy for BindingAddress
Source§impl Debug for BindingAddress
impl Debug for BindingAddress
Source§impl Display for BindingAddress
impl Display for BindingAddress
impl Eq for BindingAddress
Source§impl Hash for BindingAddress
impl Hash for BindingAddress
Source§impl PartialEq for BindingAddress
impl PartialEq for BindingAddress
impl StructuralPartialEq for BindingAddress
Auto Trait Implementations§
impl Freeze for BindingAddress
impl RefUnwindSafe for BindingAddress
impl Send for BindingAddress
impl Sync for BindingAddress
impl Unpin for BindingAddress
impl UnsafeUnpin for BindingAddress
impl UnwindSafe for BindingAddress
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = !
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.