pub struct StrWithHeader<Header> {
pub header: Header,
pub str: str,
/* private fields */
}Expand description
A custom str-based DST.
The length is stored as a usize at offset 0.
This must be the length of the trailing slice.
Fields§
§header: HeaderThe included header. Does not dictate the slice length.
str: strThe included str.
Implementations§
Source§impl<Header> StrWithHeader<Header>
impl<Header> StrWithHeader<Header>
Sourcepub fn new<A>(header: Header, s: &str) -> Awhere
A: AllocSliceDst<Self>,
pub fn new<A>(header: Header, s: &str) -> Awhere
A: AllocSliceDst<Self>,
Create a new str/header DST in a AllocSliceDst container.
Trait Implementations§
Source§impl<Header: Debug> Debug for StrWithHeader<Header>
impl<Header: Debug> Debug for StrWithHeader<Header>
Source§impl<Header> Erasable for StrWithHeader<Header>
Available on crate feature erasable only.
impl<Header> Erasable for StrWithHeader<Header>
Available on crate feature
erasable only.Source§impl<Header: Hash> Hash for StrWithHeader<Header>
impl<Header: Hash> Hash for StrWithHeader<Header>
Source§impl<Header: PartialEq> PartialEq for StrWithHeader<Header>
impl<Header: PartialEq> PartialEq for StrWithHeader<Header>
Source§fn eq(&self, other: &StrWithHeader<Header>) -> bool
fn eq(&self, other: &StrWithHeader<Header>) -> bool
Tests for
self and other values to be equal, and is used by ==.