#[repr(C)]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: Header
The included header. Does not dictate the slice length.
str: str
The 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.