From cab125297bf1430f790869b6e7099c80345c1124 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sat, 20 Nov 2021 16:52:17 +0100 Subject: [PATCH] proxmox-async: improve dev docs Signed-off-by: Dietmar Maurer --- proxmox-async/src/blocking/std_channel_stream.rs | 2 +- proxmox-async/src/blocking/tokio_writer_adapter.rs | 4 ++-- proxmox-async/src/blocking/wrapped_reader_stream.rs | 2 +- proxmox-async/src/broadcast_future.rs | 2 ++ proxmox-async/src/stream/async_reader_stream.rs | 2 +- proxmox-async/src/stream/mod.rs | 2 +- proxmox-async/src/zip.rs | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/proxmox-async/src/blocking/std_channel_stream.rs b/proxmox-async/src/blocking/std_channel_stream.rs index 48785dbf..cc27a4b3 100644 --- a/proxmox-async/src/blocking/std_channel_stream.rs +++ b/proxmox-async/src/blocking/std_channel_stream.rs @@ -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(pub Receiver); impl Stream for StdChannelStream { diff --git a/proxmox-async/src/blocking/tokio_writer_adapter.rs b/proxmox-async/src/blocking/tokio_writer_adapter.rs index 7b7f5dcf..fbce3a5c 100644 --- a/proxmox-async/src/blocking/tokio_writer_adapter.rs +++ b/proxmox-async/src/blocking/tokio_writer_adapter.rs @@ -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); diff --git a/proxmox-async/src/blocking/wrapped_reader_stream.rs b/proxmox-async/src/blocking/wrapped_reader_stream.rs index d9603a23..426c0ef8 100644 --- a/proxmox-async/src/blocking/wrapped_reader_stream.rs +++ b/proxmox-async/src/blocking/wrapped_reader_stream.rs @@ -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 { reader: R, buffer: Vec, diff --git a/proxmox-async/src/broadcast_future.rs b/proxmox-async/src/broadcast_future.rs index 7bfd83b7..6046fd6c 100644 --- a/proxmox-async/src/broadcast_future.rs +++ b/proxmox-async/src/broadcast_future.rs @@ -1,3 +1,5 @@ +//! Broadcast results to registered listeners + use std::future::Future; use std::pin::Pin; use std::sync::{Arc, Mutex}; diff --git a/proxmox-async/src/stream/async_reader_stream.rs b/proxmox-async/src/stream/async_reader_stream.rs index 6f1b5a15..5f94dce6 100644 --- a/proxmox-async/src/stream/async_reader_stream.rs +++ b/proxmox-async/src/stream/async_reader_stream.rs @@ -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 { reader: R, buffer: Vec, diff --git a/proxmox-async/src/stream/mod.rs b/proxmox-async/src/stream/mod.rs index f40ba7bf..b26f2bfe 100644 --- a/proxmox-async/src/stream/mod.rs +++ b/proxmox-async/src/stream/mod.rs @@ -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; diff --git a/proxmox-async/src/zip.rs b/proxmox-async/src/zip.rs index 16869fdd..12d9f297 100644 --- a/proxmox-async/src/zip.rs +++ b/proxmox-async/src/zip.rs @@ -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 +//! use std::convert::TryInto; use std::ffi::OsString;