Trait win_crypto_ng::helpers::AsBytes
source · pub unsafe trait AsBytes {
// Provided methods
fn as_bytes(&self) -> &[u8] ⓘ { ... }
fn into_bytes(self: Box<Self>) -> Box<[u8]> { ... }
}
Expand description
Marker trait for types that can be safely converted to bytes.
Safety
Implementee MUST be #[repr(C)]
and:
- not contain any pointer types that are dereferenced,
- itself or any of its members MUST NOT implement a custom destructor,
- be inhabited,
- allow any bit pattern
Layout
Implementee also needs to be layout-compatible with u8.