proxmox-async: improve dev docs

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
Dietmar Maurer 2021-11-20 16:52:17 +01:00
parent 5bd54b4d9b
commit cab125297b
7 changed files with 9 additions and 7 deletions

View File

@ -6,7 +6,7 @@ use futures::stream::Stream;
use crate::runtime::block_in_place;
/// Wrapper struct to convert a channel Receiver into a Stream
/// Wrapper struct to convert a sync channel [Receiver] into a [Stream]
pub struct StdChannelStream<T>(pub Receiver<T>);
impl<T> Stream for StdChannelStream<T> {

View File

@ -2,9 +2,9 @@ use std::io::Write;
use tokio::task::block_in_place;
/// Wrapper around a writer which implements Write
/// Wrapper around [Write] which adds [block_in_place]
///
/// wraps each write with a 'block_in_place' so that
/// wraps each write with a [block_in_place] so that
/// any (blocking) writer can be safely used in async context in a
/// tokio runtime
pub struct TokioWriterAdapter<W: Write>(W);

View File

@ -6,7 +6,7 @@ use futures::stream::Stream;
use crate::runtime::block_in_place;
/// Wrapper struct to convert a Reader into a Stream
/// Wrapper struct to convert sync [Read] into a [Stream]
pub struct WrappedReaderStream<R: Read + Unpin> {
reader: R,
buffer: Vec<u8>,

View File

@ -1,3 +1,5 @@
//! Broadcast results to registered listeners
use std::future::Future;
use std::pin::Pin;
use std::sync::{Arc, Mutex};

View File

@ -8,7 +8,7 @@ use tokio::io::{AsyncRead, ReadBuf};
use futures::ready;
use futures::stream::Stream;
/// Wrapper struct to convert an AsyncReader into a Stream
/// Wrapper struct to convert an [AsyncRead] into a [Stream]
pub struct AsyncReaderStream<R: AsyncRead + Unpin> {
reader: R,
buffer: Vec<u8>,

View File

@ -1,4 +1,4 @@
//! Wrappers between async readers and streams.
//! Helper which implement tokio streams.
mod async_reader_stream;
pub use async_reader_stream::AsyncReaderStream;

View File

@ -2,7 +2,7 @@
//!
//! Provides an interface to create a ZIP File from ZipEntries
//! for a more detailed description of the ZIP format, see:
//! https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
//! <https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT>
use std::convert::TryInto;
use std::ffi::OsString;