pub trait BorrowDecode<'de, Format = ()>: Sized {
// Required method
fn borrow_decode(r: &mut BorrowReader<'de>) -> Result<Self, DecodeError>;
}Expand description
Types which can be decoded from storekey format with borrowed ownership.
This trait is very similar to the Decode trait with the exception that this trait allows
for zero-copy deserialization. Allowing the deserialization of the escaped variants of str
EscapedStr and [u8] EscapedSlice as well as deserializing Cow<str> and
Cow<[u8]> borrowing directly from the reader if possible.
Required Methods§
fn borrow_decode(r: &mut BorrowReader<'de>) -> Result<Self, DecodeError>
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.