Struct box_stream::BoxReader [] [src]

pub struct BoxReader<R: Read> { /* fields omitted */ }

Wraps a reader, decrypting all reads.

Methods

impl<R: Read> BoxReader<R>
[src]

Create a new reader, wrapping inner and using key and nonce for decryption.

Gets a reference to the underlying reader.

Gets a mutable reference to the underlying reader.

It is inadvisable to directly write to the underlying reader.

Unwraps this BoxReader, returning the underlying reader.

Trait Implementations

impl<R: Read> Read for BoxReader<R>
[src]

Read bytes from the wrapped reader and decrypt them.

Errors

In addition to propagating all errors from the wrapped reader, a BoxReader produces the following error kinds:

  • ErrorKind::InvalidData: If data could not be decrypted, or if a header declares an invalid length. Possible error values are INVALID_LENGTH, UNAUTHENTICATED_HEADER, UNAUTHENTICATED_PACKET.
  • ErrorKind::Other: This is used to signal that a final header has been read. In this case, the error value is FINAL_ERROR.

🔬 This is a nightly-only experimental API. (read_initializer)

Determines if this Reader can work with buffers of uninitialized memory. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read the exact number of bytes required to fill buf. Read more

Creates a "by reference" adaptor for this instance of Read. Read more

Transforms this Read instance to an Iterator over its bytes. Read more

🔬 This is a nightly-only experimental API. (io)

the semantics of a partial read/write of where errors happen is currently unclear and may change

Transforms this Read instance to an Iterator over chars. Read more

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

Creates an adaptor which will read at most limit bytes from it. Read more

impl<AR: AsyncRead> AsyncRead for BoxReader<AR>
[src]

Prepares an uninitialized buffer to be safe to pass to read. Returns true if the supplied buffer was zeroed out. Read more

Pull some bytes from this source into the specified Buf, returning how many bytes were read. Read more

Provides a Stream and Sink interface for reading and writing to this Io object, using Decode and Encode to read and write the raw data. Read more

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