pub type CowStr = Cow<'static, str>;Expand description
Alias for a clone-on-write value containing a statically allocated string.
Aliased Type§
enum CowStr {
Borrowed(&'static str),
Owned(String),
}Variants§
Trait Implementations§
source§impl Decodable for CowStr
impl Decodable for CowStr
source§fn decode(
&mut self,
reader: &mut (impl ReadsDecodable + ?Sized),
header: Option<DataHeader>
) -> Result<(), CodecError>
fn decode( &mut self, reader: &mut (impl ReadsDecodable + ?Sized), header: Option<DataHeader> ) -> Result<(), CodecError>
source§fn decode_from(
reader: &mut (impl ReadsDecodable + ?Sized)
) -> Result<Self, CodecError>where
Self: Default,
fn decode_from(
reader: &mut (impl ReadsDecodable + ?Sized)
) -> Result<Self, CodecError>where
Self: Default,
Returns a new, default
Self
decoded from reader.source§impl Encodable for CowStr
impl Encodable for CowStr
source§fn encode(
&self,
writer: &mut (impl WritesEncodable + ?Sized)
) -> Result<(), CodecError>
fn encode( &self, writer: &mut (impl WritesEncodable + ?Sized) ) -> Result<(), CodecError>
Encodes this thing’s data into
writer.source§fn encode_header(
&self,
writer: &mut (impl WritesEncodable + ?Sized)
) -> Result<(), CodecError>
fn encode_header( &self, writer: &mut (impl WritesEncodable + ?Sized) ) -> Result<(), CodecError>
Encodes the header for this thing’s data
format into
writer. Read more