You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit does two things:
- It makes the `DecWriter` the "inverse" type
for `EncWriter`. This includes handling panic'ing
of the inner writer, adding documentation, runnable
examples a.s.o.
- It introduces the `Close` trait which is implemented by
`EncWriter` and `DecWriter`. Both should be closed
explicatly after processing data to complete the
en/decryption process and handle potential errors. (e.g. decryption fails)
Now, the `flush` implementation of `EncWriter` and `DecWriter`
only flushes the inner writer. An `EncWriter` or `DecWriter`
cannot really be flushed since flushing the buffered data effectively
means "creating" the final fragment such that no more data can be
written.
By only flushing the inner writer, `flush` can now be called multiple
times and still cause e.g. writing any buffered (by the inner writer)
out. If calling code want to complete the en/decryption it should call
`close`.
0 commit comments