Type Alias pact::CowStr

source ·
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§

§1.0.0

Borrowed(&'static str)

Borrowed data.

§1.0.0

Owned(String)

Owned data.

Trait Implementations§

source§

impl Decodable for CowStr

source§

fn decode( &mut self, reader: &mut (impl ReadsDecodable + ?Sized), header: Option<DataHeader> ) -> Result<(), CodecError>

Decodes data with format from reader into this thing count times. Read more
source§

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

source§

const FORMAT: Format = <[u8]>::FORMAT

This thing’s Format.
source§

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>

Encodes the header for this thing’s data format into writer. Read more