Expand description
Declare DataStream, a type that wraps DataReader and DataWriter so as to be useful for byte-oriented communication.
Re-exportsยง
use crate::Error;๐use crate::Result;๐use static_assertions::assert_impl_all;๐use tor_cell::relaycell::msg::EndReason;๐use tor_cell::relaycell::RelayCellFormat;๐use tor_cell::relaycell::RelayCmd;๐use futures::io::AsyncRead;๐use futures::io::AsyncWrite;๐use futures::stream::StreamExt;๐use futures::task::Context;๐use futures::task::Poll;๐use futures::Future;๐use futures::Stream;๐use pin_project::pin_project;๐use postage::watch;๐use tokio_crate::io::ReadBuf;๐use tokio_crate::io::AsyncRead as TokioAsyncRead;๐use tokio_crate::io::AsyncWrite as TokioAsyncWrite;๐use tokio_util::compat::FuturesAsyncReadCompatExt;๐use tokio_util::compat::FuturesAsyncWriteCompatExt;๐use tor_cell::restricted_msg;๐use std::fmt::Debug;๐use std::fmt::Debug;๐use std::io::Result as IoResult;๐use std::num::NonZero;๐use std::pin::Pin;๐use std::sync::Arc;๐use std::sync::Mutex;๐use std::sync::Weak;๐use educe::Educe;๐use crate::client::ClientTunnel;๐use crate::memquota::StreamAccount;๐use crate::stream::StreamReceiver;๐use crate::stream::StreamTarget;๐use crate::stream::Tunnel;๐use crate::stream::cmdcheck::AnyCmdChecker;๐use crate::stream::cmdcheck::CmdChecker;๐use crate::stream::cmdcheck::StreamStatus;๐use crate::stream::flow_ctrl::state::StreamRateLimit;๐use crate::stream::flow_ctrl::xon_xoff::reader::BufferIsEmpty;๐use crate::stream::flow_ctrl::xon_xoff::reader::XonXoffReader;๐use crate::stream::flow_ctrl::xon_xoff::reader::XonXoffReaderCtrl;๐use tor_async_utils::rate_limited_writer::DynamicRateLimitedWriter;๐use tor_async_utils::rate_limited_writer::RateLimitedWriter;๐use tor_async_utils::rate_limited_writer::RateLimitedWriterConfig;๐use tor_basic_utils::onionperf_types::OnionperfEvent;๐use tor_basic_utils::onionperf_types::OnionperfStreamStatus;๐use tor_basic_utils::skip_fmt;๐use tor_cell::relaycell::msg::Data;๐use tor_error::internal;๐use tor_rtcompat::CoarseTimeProvider;๐use tor_rtcompat::DynTimeProvider;๐use tor_rtcompat::SleepProvider;๐
Structsยง
- Client
Data Stream Ctrl - An object used to control and monitor a data stream.
- Data
Reader - The read half of a
DataStream, implementingfutures::io::AsyncRead. - Data
Reader ๐Impl - Wrapper for the read part of a
DataStream. - Data
Reader ๐Inner - The inner reader for
DataReader. - Data
Stream - An anonymized stream over the Tor network.
- Data
Stream ๐Status - Shared status flags for tracking the status of as
DataStream. - Data
Writer - The write half of a
DataStream, implementingfutures::io::AsyncWrite. - Data
Writer ๐Impl - Internal: the write part of a DataStream
- Data
Writer ๐Inner - The inner writer for
DataWriter. - Outbound
Data ๐CmdChecker - A
CmdCheckerthat enforces invariants for outbound data streams.
Enumsยง
- Client
Data ๐Stream Msg - An allowable incoming message on a client data stream.
- Data
Reader ๐State - An enumeration for the state of a
DataReaderInner. - Data
Writer ๐State - An enumeration for the state of a DataWriter.
Type Aliasesยง
- BoxSync
Future ๐ - Helper type: Like BoxFuture, but also requires that the future be Sync.
- Rate
Config ๐Stream - A stream of
RateLimitedWriterConfigused to update aDynamicRateLimitedWriter.