Fix documentation

main
Laurent Pelecq 2 years ago
parent 3622313d78
commit fe74259e43

@ -1,6 +1,6 @@
[package] [package]
name = "ssip-client" name = "ssip-client"
version = "0.5.0" version = "0.5.1"
authors = ["Laurent Pelecq <lpelecq+rust@circoise.eu>"] authors = ["Laurent Pelecq <lpelecq+rust@circoise.eu>"]
edition = "2018" edition = "2018"
description = "Client API for Speech Dispatcher" description = "Client API for Speech Dispatcher"

@ -7,15 +7,28 @@
// option. All files in the project carrying such notice may not be copied, // option. All files in the project carrying such notice may not be copied,
// modified, or distributed except according to those terms. // modified, or distributed except according to those terms.
use mio::event::Source;
use std::collections::VecDeque; use std::collections::VecDeque;
use std::io::{self, Read, Write}; use std::io::{self, Read, Write};
use crate::{ use crate::{
client::{Client, Request, Response}, client::{Client, Request, Response, Source},
types::*, types::*,
}; };
// Hack to generate the doc. There must be a better way.
#[cfg(all(not(feature = "async-mio"), doc))]
mod mio {
/// Polls for readiness events on all registered values.
///
/// See [`mio::Poll`](https://docs.rs/mio/latest/mio/struct.Poll.html#)
pub struct Poll {}
/// Source identifier.
///
/// See [`mio::Token`](https://docs.rs/mio/latest/mio/struct.Token.html#).
pub struct Token(pub usize);
}
const INITIAL_REQUEST_QUEUE_CAPACITY: usize = 4; const INITIAL_REQUEST_QUEUE_CAPACITY: usize = 4;
/// Asynchronous client based on `mio`. /// Asynchronous client based on `mio`.

@ -17,10 +17,10 @@ use crate::types::*;
// Trick to have common implementation for std and mio streams.. // Trick to have common implementation for std and mio streams..
#[cfg(not(feature = "async-mio"))] #[cfg(not(feature = "async-mio"))]
use std::fmt::Debug as Source; pub(crate) use std::fmt::Debug as Source;
#[cfg(feature = "async-mio")] #[cfg(feature = "async-mio")]
use mio::event::Source; pub(crate) use mio::event::Source;
/// Convert boolean to ON or OFF /// Convert boolean to ON or OFF
fn on_off(value: bool) -> &'static str { fn on_off(value: bool) -> &'static str {
@ -165,8 +165,8 @@ macro_rules! send_range {
/// SSIP client on generic stream /// SSIP client on generic stream
/// ///
/// There are two ways to send requests and receive responses: /// There are two ways to send requests and receive responses:
/// * Either with the generic [`send`] and [`receive`] /// * Either with the generic [`Client::send`] and [`Client::receive`]
/// * Or with the specific methods such as [`set_rate`], ..., [`get_rate`], ... /// * Or with the specific methods such as [`Client::set_rate`], ..., [`Client::get_rate`], ...
pub struct Client<S: Read + Write + Source> { pub struct Client<S: Read + Write + Source> {
input: io::BufReader<S>, input: io::BufReader<S>,
output: io::BufWriter<S>, output: io::BufWriter<S>,

@ -45,5 +45,5 @@ pub use types::*;
#[cfg(any(feature = "async-mio", doc))] #[cfg(any(feature = "async-mio", doc))]
mod async_mio; mod async_mio;
#[cfg(feature = "async-mio")] #[cfg(any(feature = "async-mio", doc))]
pub use async_mio::AsyncClient; pub use async_mio::AsyncClient;

Loading…
Cancel
Save