pub struct InstanceInformation {
pub ip_addresses: HashSet<IpAddr>,
pub ports: HashSet<u16>,
pub attributes: HashMap<String, Option<String>>,
/* private fields */
}
Expand description
Represents a single instance of the service. Notice that it is not possible to associate a port to a single ip address, due to limitations of the DNS protocol
Fields§
§ip_addresses: HashSet<IpAddr>
Ips for this instance
ports: HashSet<u16>
Ports for this instance
attributes: HashMap<String, Option<String>>
Attributes for this instance
Implementations§
Source§impl<'a> InstanceInformation
impl<'a> InstanceInformation
Sourcepub fn with_socket_address(self, socket_address: SocketAddr) -> Self
pub fn with_socket_address(self, socket_address: SocketAddr) -> Self
Adds the ip_address
and port
to this instance information. This is the equivalent of
with_ip_address(ip_address).with_port(port)
Sourcepub fn with_ip_address(self, ip_address: IpAddr) -> Self
pub fn with_ip_address(self, ip_address: IpAddr) -> Self
Adds ip_address
to the list of ip addresses for this instance
Sourcepub fn with_attribute(self, key: String, value: Option<String>) -> Self
pub fn with_attribute(self, key: String, value: Option<String>) -> Self
Add and attribute to the list of attributes
Sourcepub fn escaped_instance_name(&self) -> String
pub fn escaped_instance_name(&self) -> String
Escape the instance name
. will be replaced with . \ will be replaced with \
Sourcepub fn unescaped_instance_name(&self) -> String
pub fn unescaped_instance_name(&self) -> String
Unescape the instance name
. will be replaced with . \ will be replaced with \
Sourcepub fn into_records(
self,
service_name: &Name<'a>,
ttl: u32,
) -> Result<Vec<ResourceRecord<'a>>, SimpleMdnsError>
pub fn into_records( self, service_name: &Name<'a>, ttl: u32, ) -> Result<Vec<ResourceRecord<'a>>, SimpleMdnsError>
Transform into a Vec
Sourcepub fn get_socket_addresses(&self) -> impl Iterator<Item = SocketAddr> + '_
pub fn get_socket_addresses(&self) -> impl Iterator<Item = SocketAddr> + '_
Creates a Iterator of SocketAddr
for each ip address and port combination
Trait Implementations§
Source§impl Clone for InstanceInformation
impl Clone for InstanceInformation
Source§fn clone(&self) -> InstanceInformation
fn clone(&self) -> InstanceInformation
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for InstanceInformation
impl Debug for InstanceInformation
Source§impl Hash for InstanceInformation
impl Hash for InstanceInformation
Source§impl PartialEq for InstanceInformation
impl PartialEq for InstanceInformation
impl Eq for InstanceInformation
impl StructuralPartialEq for InstanceInformation
Auto Trait Implementations§
impl Freeze for InstanceInformation
impl RefUnwindSafe for InstanceInformation
impl Send for InstanceInformation
impl Sync for InstanceInformation
impl Unpin for InstanceInformation
impl UnwindSafe for InstanceInformation
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