Struct arti_tor_client::DataStream[][src]

pub struct DataStream { /* fields omitted */ }
Expand description

An anonymized stream over the Tor network.

For most purposes, you can think of this type as an anonymized TCP stream: it can read and write data, and get closed when it’s done.

To get one of these, clients should use TorClient::connect(). DataStream implements [futures::io::AsyncRead] and [futures::io::AsyncWrite], so you can use it anywhere that those types are expected.

This type is a re-export from tor_proto::stream::DataStream; see that crate for its documentation in a more low-level context. A DataStream is a Tor stream packaged so as to be useful for byte-oriented IO.

It’s suitable for use with BEGIN or BEGIN_DIR streams.

Semver note:

Note that this type is re-exported as a part of the public API of the tor-client crate. Any changes to its API here in tor-proto need to be reflected above.

Implementations

An anonymized stream over the Tor network.

For most purposes, you can think of this type as an anonymized TCP stream: it can read and write data, and get closed when it’s done.

To get one of these, clients should use TorClient::connect(). DataStream implements [futures::io::AsyncRead] and [futures::io::AsyncWrite], so you can use it anywhere that those types are expected.

This type is a re-export from tor_proto::stream::DataStream; see that crate for its documentation in a more low-level context.

Divide this DataStream into its consituent parts.

Trait Implementations

Attempt to read from the AsyncRead into buf. Read more

Attempt to read from the AsyncRead into bufs using vectored IO operations. Read more

Attempt to write bytes from buf into the object. Read more

Attempt to flush the object, ensuring that any buffered data reach their destination. Read more

Attempt to close the object. Read more

Attempt to write bytes from bufs into the object using vectored IO operations. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Creates an adaptor which will chain this stream with another. Read more

Tries to read some bytes directly into the given buf in asynchronous manner, returning a future type. Read more

Creates a future which will read from the AsyncRead into bufs using vectored IO operations. Read more

Creates a future which will read exactly enough bytes to fill buf, returning an error if end of file (EOF) is hit sooner. Read more

Creates a future which will read all the bytes from this AsyncRead. Read more

Creates a future which will read all the bytes from this AsyncRead. Read more

Helper method for splitting this read/write object into two halves. Read more

Creates an AsyncRead adapter which will read at most limit bytes from the underlying reader. Read more

Creates a future which will entirely flush this AsyncWrite. Read more

Creates a future which will entirely close this AsyncWrite.

Creates a future which will write bytes from buf into the object. Read more

Creates a future which will write bytes from bufs into the object using vectored IO operations. Read more

Write data into this object. Read more

Allow using an [AsyncWrite] as a Sink<Item: AsRef<[u8]>>. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Wraps self with a compatibility layer that implements tokio_io::AsyncRead. Read more

Wraps self with a compatibility layer that implements tokio::io::AsyncWrite. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.