Struct savefile::CryptoWriter [−][src]
pub struct CryptoWriter<'a> { /* fields omitted */ }
Expand description
A cryptographic stream wrapper. Wraps a plain dyn Write, and itself implements Write, encrypting all data written.
Implementations
pub fn new(
writer: &'a mut dyn Write,
key_bytes: [u8; 32]
) -> Result<CryptoWriter<'a>, SavefileError>
[src]
pub fn new(
writer: &'a mut dyn Write,
key_bytes: [u8; 32]
) -> Result<CryptoWriter<'a>, SavefileError>
[src]Create a new CryptoWriter, wrapping the given Write . Encrypts using the given 32 byte cryptographic key. Crypto is 256 bit AES GCM
Data is encrypted in chunks. Calling this unconditionally finalizes a chunk, actually emitting data to the underlying dyn Write. When later reading data, an entire chunk must be read from file before any plaintext is produced.
Trait Implementations
Writes any non-written buffered bytes to the underlying stream. If this fails, there is no recovery. The buffered data will have been lost.
Write a buffer into this writer, returning how many bytes were written. Read more
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
Attempts to write an entire buffer into this writer. Read more
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Writes a formatted string into this writer, returning any error encountered. Read more
Auto Trait Implementations
impl<'a> !RefUnwindSafe for CryptoWriter<'a>
impl<'a> !Send for CryptoWriter<'a>
impl<'a> !Sync for CryptoWriter<'a>
impl<'a> Unpin for CryptoWriter<'a>
impl<'a> !UnwindSafe for CryptoWriter<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Writes an unsigned 8 bit integer to the underlying writer. Read more
Writes a signed 8 bit integer to the underlying writer. Read more
Writes an unsigned 16 bit integer to the underlying writer. Read more
Writes a signed 16 bit integer to the underlying writer. Read more
Writes an unsigned 24 bit integer to the underlying writer. Read more
Writes a signed 24 bit integer to the underlying writer. Read more
Writes an unsigned 32 bit integer to the underlying writer. Read more
Writes a signed 32 bit integer to the underlying writer. Read more
Writes an unsigned 48 bit integer to the underlying writer. Read more
Writes a signed 48 bit integer to the underlying writer. Read more
Writes an unsigned 64 bit integer to the underlying writer. Read more
Writes a signed 64 bit integer to the underlying writer. Read more
Writes an unsigned 128 bit integer to the underlying writer.
Writes a signed 128 bit integer to the underlying writer.
Writes an unsigned n-bytes integer to the underlying writer. Read more
Writes a signed n-bytes integer to the underlying writer. Read more
Writes an unsigned n-bytes integer to the underlying writer. Read more
Writes a signed n-bytes integer to the underlying writer. Read more
Writes a IEEE754 single-precision (4 bytes) floating point number to the underlying writer. Read more