proxmox-async: improve dev docs
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
parent
5bd54b4d9b
commit
cab125297b
@ -6,7 +6,7 @@ use futures::stream::Stream;
|
|||||||
|
|
||||||
use crate::runtime::block_in_place;
|
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>);
|
pub struct StdChannelStream<T>(pub Receiver<T>);
|
||||||
|
|
||||||
impl<T> Stream for StdChannelStream<T> {
|
impl<T> Stream for StdChannelStream<T> {
|
||||||
|
@ -2,9 +2,9 @@ use std::io::Write;
|
|||||||
|
|
||||||
use tokio::task::block_in_place;
|
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
|
/// any (blocking) writer can be safely used in async context in a
|
||||||
/// tokio runtime
|
/// tokio runtime
|
||||||
pub struct TokioWriterAdapter<W: Write>(W);
|
pub struct TokioWriterAdapter<W: Write>(W);
|
||||||
|
@ -6,7 +6,7 @@ use futures::stream::Stream;
|
|||||||
|
|
||||||
use crate::runtime::block_in_place;
|
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> {
|
pub struct WrappedReaderStream<R: Read + Unpin> {
|
||||||
reader: R,
|
reader: R,
|
||||||
buffer: Vec<u8>,
|
buffer: Vec<u8>,
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
//! Broadcast results to registered listeners
|
||||||
|
|
||||||
use std::future::Future;
|
use std::future::Future;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
@ -8,7 +8,7 @@ use tokio::io::{AsyncRead, ReadBuf};
|
|||||||
use futures::ready;
|
use futures::ready;
|
||||||
use futures::stream::Stream;
|
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> {
|
pub struct AsyncReaderStream<R: AsyncRead + Unpin> {
|
||||||
reader: R,
|
reader: R,
|
||||||
buffer: Vec<u8>,
|
buffer: Vec<u8>,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
//! Wrappers between async readers and streams.
|
//! Helper which implement tokio streams.
|
||||||
|
|
||||||
mod async_reader_stream;
|
mod async_reader_stream;
|
||||||
pub use async_reader_stream::AsyncReaderStream;
|
pub use async_reader_stream::AsyncReaderStream;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//!
|
//!
|
||||||
//! Provides an interface to create a ZIP File from ZipEntries
|
//! Provides an interface to create a ZIP File from ZipEntries
|
||||||
//! for a more detailed description of the ZIP format, see:
|
//! 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::convert::TryInto;
|
||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
|
Loading…
Reference in New Issue
Block a user