combine files
Signed-off-by: Walker Crouse <walker.crouse@coop.co.uk>
This commit is contained in:
parent
4314369bf6
commit
fefdaa4f2c
@ -129,7 +129,6 @@ extern crate derive_new;
|
|||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
extern crate maplit;
|
extern crate maplit;
|
||||||
|
|
||||||
mod registration;
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
mod macros;
|
mod macros;
|
||||||
mod interface;
|
mod interface;
|
||||||
@ -152,7 +151,7 @@ pub mod macos;
|
|||||||
|
|
||||||
pub use browser::{ServiceDiscoveredCallback, ServiceDiscovery};
|
pub use browser::{ServiceDiscoveredCallback, ServiceDiscovery};
|
||||||
pub use interface::*;
|
pub use interface::*;
|
||||||
pub use registration::*;
|
pub use service::{ServiceRegisteredCallback, ServiceRegistration};
|
||||||
|
|
||||||
/// Type alias for the platform-specific mDNS browser implementation
|
/// Type alias for the platform-specific mDNS browser implementation
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
use std::any::Any;
|
|
||||||
use std::sync::Arc;
|
|
||||||
|
|
||||||
/// Callback invoked from [`MdnsService`] once it has successfully registered.
|
|
||||||
///
|
|
||||||
/// # Arguments
|
|
||||||
/// * `service` - The service information that was registered
|
|
||||||
/// * `context` - The optional user context passed through
|
|
||||||
///
|
|
||||||
/// [`MdnsService`]: type.MdnsService.html
|
|
||||||
pub type ServiceRegisteredCallback =
|
|
||||||
dyn Fn(Result<ServiceRegistration, super::error::Error>, Option<Arc<dyn Any>>);
|
|
||||||
|
|
||||||
/// Represents a registration event for a [`MdnsService`].
|
|
||||||
///
|
|
||||||
/// [`MdnsService`]: type.MdnsService.html
|
|
||||||
#[derive(Builder, BuilderDelegate, Debug, Getters, Clone, Default, PartialEq, Eq)]
|
|
||||||
pub struct ServiceRegistration {
|
|
||||||
name: String,
|
|
||||||
kind: String,
|
|
||||||
domain: String,
|
|
||||||
}
|
|
@ -1,7 +1,8 @@
|
|||||||
//! Trait definition for cross-platform service.
|
//! Trait definition for cross-platform service.
|
||||||
|
|
||||||
use crate::{EventLoop, NetworkInterface, Result, ServiceRegisteredCallback, TxtRecord};
|
use crate::{EventLoop, NetworkInterface, Result, TxtRecord};
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
/// Interface for interacting with underlying mDNS service implementation registration
|
/// Interface for interacting with underlying mDNS service implementation registration
|
||||||
/// capabilities.
|
/// capabilities.
|
||||||
@ -47,3 +48,22 @@ pub trait TMdnsService {
|
|||||||
/// the service alive.
|
/// the service alive.
|
||||||
fn register(&mut self) -> Result<EventLoop>;
|
fn register(&mut self) -> Result<EventLoop>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Callback invoked from [`MdnsService`] once it has successfully registered.
|
||||||
|
///
|
||||||
|
/// # Arguments
|
||||||
|
/// * `service` - The service information that was registered
|
||||||
|
/// * `context` - The optional user context passed through
|
||||||
|
///
|
||||||
|
/// [`MdnsService`]: type.MdnsService.html
|
||||||
|
pub type ServiceRegisteredCallback = dyn Fn(Result<ServiceRegistration>, Option<Arc<dyn Any>>);
|
||||||
|
|
||||||
|
/// Represents a registration event for a [`MdnsService`].
|
||||||
|
///
|
||||||
|
/// [`MdnsService`]: type.MdnsService.html
|
||||||
|
#[derive(Builder, BuilderDelegate, Debug, Getters, Clone, Default, PartialEq, Eq)]
|
||||||
|
pub struct ServiceRegistration {
|
||||||
|
name: String,
|
||||||
|
kind: String,
|
||||||
|
domain: String,
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user