pub struct ServiceInstance {
pub instance_name: String,
pub service_type: ServiceType,
pub port: u16,
pub target: String,
pub priority: u16,
pub weight: u16,
pub txt: TxtRecord,
}Expand description
A registered DNS-SD service instance
Fields§
§instance_name: StringHuman-readable instance name (e.g., “My Web Server”)
service_type: ServiceTypeService type (e.g., “_http._tcp”)
port: u16Port number
target: StringTarget hostname (defaults to local hostname)
priority: u16Priority for SRV record
weight: u16Weight for SRV record
txt: TxtRecordTXT record metadata
Implementations§
Source§impl ServiceInstance
impl ServiceInstance
Sourcepub fn full_name(&self) -> String
pub fn full_name(&self) -> String
Construct the full service instance name e.g., “My Web Server._http._tcp.local”
Sourcepub fn encode_srv_rdata(&self) -> Vec<u8>
pub fn encode_srv_rdata(&self) -> Vec<u8>
Encode SRV rdata to wire format: priority(2) + weight(2) + port(2) + target(variable)
Trait Implementations§
Source§impl Clone for ServiceInstance
impl Clone for ServiceInstance
Source§fn clone(&self) -> ServiceInstance
fn clone(&self) -> ServiceInstance
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServiceInstance
impl Debug for ServiceInstance
Source§impl PartialEq for ServiceInstance
impl PartialEq for ServiceInstance
impl Eq for ServiceInstance
impl StructuralPartialEq for ServiceInstance
Auto Trait Implementations§
impl Freeze for ServiceInstance
impl RefUnwindSafe for ServiceInstance
impl Send for ServiceInstance
impl Sync for ServiceInstance
impl Unpin for ServiceInstance
impl UnwindSafe for ServiceInstance
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)