ps_ecc/cow/mod.rs
1mod implementations;
2mod methods;
3
4use ps_buffer::SharedBuffer;
5
6/// A borrowed-or-owned byte buffer.
7///
8/// Equality, ordering, and hashing compare the referenced bytes, so a
9/// [`Cow::Borrowed`] and a [`Cow::Owned`] with the same content are equal.
10#[derive(Debug)]
11pub enum Cow<'lt> {
12 /// Borrows the caller's bytes; no allocation took place.
13 Borrowed(&'lt [u8]),
14 /// Owns a shared buffer, typically holding corrected bytes.
15 Owned(SharedBuffer),
16}