ssdp_client/
lib.rs

1#![warn(
2    missing_docs,
3    nonstandard_style,
4    rust_2018_idioms,
5    future_incompatible,
6    missing_debug_implementations
7)]
8
9//! An asynchronous library for discovering, notifying and subscribing to devices and services on a network.
10//!
11//! SSDP stands for Simple Service Discovery Protocol and it is a protocol that
12//! distributes messages across a local network for devices and services to
13//! discover each other. SSDP can most commonly be found in devices that implement
14//! `UPnP` as it is used as the discovery mechanism for that standard.
15//!
16//! # Example
17//! ```rust,no_run
18//! # async fn f() -> Result<(), ssdp_client::Error> {
19//! use futures::prelude::*;
20//! use std::time::Duration;
21//! use ssdp_client::SearchTarget;
22//!
23//! let search_target = SearchTarget::RootDevice;
24//! let mut responses = ssdp_client::search(&search_target, Duration::from_secs(3), 2, None).await?;
25//!
26//! while let Some(response) = responses.next().await {
27//!     println!("{:?}", response?);
28//! }
29//! # return Ok(());
30//! # }
31//! ```
32
33/// SSDP Error types
34mod error;
35mod search;
36mod search_target;
37
38pub use error::Error;
39pub use search::{search, SearchResponse};
40pub use search_target::{SearchTarget, URN};