pub struct DiscoveryEngine {
pub service_type: String,
}Fields§
§service_type: StringImplementations§
Source§impl DiscoveryEngine
impl DiscoveryEngine
pub fn new() -> Self
pub fn get_local_ip() -> String
pub fn announce( &self, service_name: &str, did: &str, port: u16, ) -> Result<(), String>
Sourcepub fn announce_with_wireguard(
&self,
service_name: &str,
did: &str,
port: u16,
wg_public_key: Option<&str>,
) -> Result<(), String>
pub fn announce_with_wireguard( &self, service_name: &str, did: &str, port: u16, wg_public_key: Option<&str>, ) -> Result<(), String>
Announce the PKC service with a WireGuard public key.
In addition to the standard mDNS properties (did, version, capabilities, protocol),
this includes wg_public_key so peers can establish WireGuard-encrypted tunnels.
pub fn discover(&self, timeout: Duration) -> Result<Vec<PeerInfo>, String>
Sourcepub async fn announce_with_cancellation(
&self,
service_name: &str,
did: &str,
port: u16,
wg_public_key: Option<&str>,
token: CancellationToken,
) -> Result<(), String>
pub async fn announce_with_cancellation( &self, service_name: &str, did: &str, port: u16, wg_public_key: Option<&str>, token: CancellationToken, ) -> Result<(), String>
Announce the PKC service asynchronously with structured cancellation.
Sourcepub async fn discover_with_cancellation(
&self,
timeout: Duration,
token: CancellationToken,
) -> Result<Vec<PeerInfo>, String>
pub async fn discover_with_cancellation( &self, timeout: Duration, token: CancellationToken, ) -> Result<Vec<PeerInfo>, String>
Discover PKC peers asynchronously with structured cancellation.
Trait Implementations§
Auto Trait Implementations§
impl Forget for DiscoveryEngine
impl Freeze for DiscoveryEngine
impl RefUnwindSafe for DiscoveryEngine
impl Send for DiscoveryEngine
impl Sync for DiscoveryEngine
impl Unpin for DiscoveryEngine
impl UnsafeUnpin for DiscoveryEngine
impl UnwindSafe for DiscoveryEngine
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