igd_next/aio/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//! This module implements the same features as the main crate, but using async io.

mod gateway;

#[cfg(feature = "aio_tokio")]
pub mod tokio;

#[cfg(feature = "aio_async_std")]
pub mod async_std;

use async_trait::async_trait;

use crate::RequestError;

pub use self::gateway::Gateway;

pub(crate) const MAX_RESPONSE_SIZE: usize = 1500;
pub(crate) const HEADER_NAME: &str = "SOAPAction";

/// Trait to allow abstracting over `tokio` and `async-std`.
#[async_trait]
pub trait Provider {
    /// Send an async request over the executor.
    async fn send_async(url: &str, action: &str, body: &str) -> Result<String, RequestError>;
}