Skip to main content

Crate tor_async_utils

Crate tor_async_utils 

Source
Expand description

ยงtor-async-utils

Utilities (low-level) for Tor

Miscellaneous futures-related utilities for tor-* and arti-*.

This crate lives near the bottom of the Tor crate stack.

If you find anything in this crate generally useful, it should probably move out into a crate of its own.

License: MIT OR Apache-2.0

Re-exportsยง

pub use prepare_send::SinkPrepareExt;
pub use prepare_send::SinkPrepareSendFuture;
pub use prepare_send::SinkSendable;
pub use sinkext::SinkExt;
pub use sink_close_channel::SinkCloseChannel;
pub use sink_try_send::ErasedSinkTrySendError;
pub use sink_try_send::MpscOtherSinkTrySendError;
pub use sink_try_send::SinkTrySend;
pub use sink_try_send::SinkTrySendError;
pub use watch::DropNotifyEofSignallable;
pub use watch::DropNotifyWatchSender;
pub use watch::PostageWatchSenderExt;
pub use oneshot_fused_workaround as oneshot;
pub(crate) use futures::channel::mpsc; ๐Ÿ”’

Modulesยง

bw_pool
A shared token pool with a lock-free fast path and FIFO waiting queue.
counting_streams
A facility for an MPSC channel that counts the number of outstanding entries on the channel.
global_rate_limit
Rate limiter objects backed by a shared crate::bw_pool::BandwidthPool making them global as in sharable accross multiple thread/tasks.
join_read_write ๐Ÿ”’
Join a readable and writeable into a single AsyncRead + AsyncWrite
oneshot_broadcast
A oneshot broadcast channel.
peekable_stream
Provides utilities for peeking at items in futures::Stream.
prepare_send ๐Ÿ”’
Extension trait for using Sink more safely.
rate_limited_writer
Rate-limited AsyncWrite writers backed by a token bucket.
sink_close_channel ๐Ÿ”’
SinkCloseChannel
sink_try_send ๐Ÿ”’
SinkTrySend
sinkext ๐Ÿ”’
Extension trait for Sink.
stream_peek
StreamUnobtrusivePeeker
watch ๐Ÿ”’
Extension trait for more efficient use of postage::watch.

Structsยง

JoinReadWrite
Async readable/writeable that dispatches reads to R and writes to W

Functionsยง

mpsc_channel_no_memquota
Precisely futures::channel::mpsc::channel