Trait ReadOverwrite

Source
pub unsafe trait ReadOverwrite: Read { }
Expand description

This marker trait declares that the Read trait is implemented correctly, that means:

  1. implementation of read() and read_exact() doesn’t read from provided buffer.
  2. if read() returns Ok(n), then each of first n bytes was overwritten.
  3. if read_exact() returns Ok(()) then each byte of buffer was overwritten.

Breaking this should not cause huge problems since untrusted input should be checked anyway but it might leak internal state of the application, containing secret data like private keys. Think of the Hartbleed bug.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§