pub trait BCowConvert<'a> {
// Required method
fn convert(self) -> Cow<'a, [u8]>;
}Expand description
Trait for macros to convert owned/borrowed types to Cow.
This is needed because &str and String do not have From
implements into Cow<_, [u8]>. One solution is to just call AsRef<[u8]>
before converting. However, then when a user specifies an owned type,
we will implicitly borrow that; this trait prevents that so that macro
behavior is intuitive, so that owned types stay owned.