Struct box_stream::BoxReader [] [src]

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

Wraps a reader, decrypting all reads.

Methods

impl<R> BoxReader<R>
[src]

[src]

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

[src]

Gets a reference to the underlying reader.

[src]

Gets a mutable reference to the underlying reader.

It is inadvisable to directly write to the underlying reader.

[src]

Unwraps this BoxReader, returning the underlying reader.

Trait Implementations

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

[src]

Read bytes from the wrapped reader and decrypt them. End of stream is signalled by returning Ok(0) even though this function was passed a buffer of nonzero length.

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::UnexpectedEof: If a call to the inner reader returned Ok(0) although it was given a buffer of nonzero length. This is an error since end of file must be signalled via a special header in a box stream. The error value for this is UNAUTHENTICATED_EOF.

[src]

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

[src]

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

Auto Trait Implementations

impl<R> Send for BoxReader<R> where
    R: Send

impl<R> Sync for BoxReader<R> where
    R: Sync