Struct ffsend_api::reader::EncryptedFileReader [] [src]

pub struct EncryptedFileReader { /* fields omitted */ }

A lazy file reader, that encrypts the file with the given cipher and appends the cryptographic tag to the end of it.

This reader is lazy because the file data loaded from the system and encrypted when it is read from the reader. This greatly reduces memory usage for large files.

This reader encrypts the file data with an appended cryptographic tag.

The reader uses a small internal buffer as data is encrypted in blocks, which may output more data than fits in the given buffer while reading. The excess data is then returned on the next read.

Methods

impl EncryptedFileReader
[src]

[src]

Construct a new reader for the given file with the given cipher.

This method consumes twice the size of the file in memory while constructing, and constructs a reader that has a size similar to the file.

It is recommended to wrap this reader in some sort of buffer, such as: std::io::BufReader

Trait Implementations

impl ExactLengthReader for EncryptedFileReader
[src]

[src]

Calculate the total length of the encrypted file with the appended tag. Useful in combination with some progress monitor, to determine how much of the file is read or for example; sent over the network.

[src]

Check whehter this extact length reader is emtpy.

impl Read for EncryptedFileReader
[src]

The reader trait implementation.

[src]

Read from the encrypted file, and then the encryption tag.

[src]

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

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

1.0.0
[src]

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

1.0.0
[src]

Read all bytes until EOF in this source, appending them to buf. Read more

1.6.0
[src]

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

Important traits for &'a mut W
1.0.0
[src]

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

Important traits for Bytes<R>
1.0.0
[src]

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

Important traits for Chars<R>
[src]

🔬 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 [char]s. Read more

Important traits for Chain<T, U>
1.0.0
[src]

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

Important traits for Take<T>
1.0.0
[src]

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

impl Send for EncryptedFileReader
[src]

Auto Trait Implementations