ssi_core/bytes_buf.rs
1/// Byte buffer.
2///
3/// Any type that implements `AsRef<[u8]>` and `Into<Vec<u8>>` such that both
4/// implementation yields the same bytes.
5///
6/// # Safety
7///
8/// The `Into<Vec<u8>>` **must** return the same bytes as `AsRef<[u8]>`.
9pub unsafe trait BytesBuf: AsRef<[u8]> + Into<Vec<u8>> {}
10
11unsafe impl BytesBuf for Vec<u8> {}
12
13unsafe impl BytesBuf for String {}