#[repr(C)]pub struct ZyanStringView_ {
pub string: ZyanString,
}Expand description
Defines the ZyanStringView struct.
The ZyanStringView type provides a view inside a string (ZyanString instances, null-
terminated C-style strings, or even not-null-terminated custom strings). A view is immutable
by design and can’t be directly converted to a C-style string.
Views might become invalid (e.g. pointing to invalid memory), if the underlying string gets destroyed or resized.
The ZYAN_STRING_TO_VIEW macro can be used to cast a ZyanString to a ZyanStringView pointer
without any runtime overhead.
Casting a view to a normal string is not supported and will lead to unexpected behavior (use
ZyanStringDuplicate to create a deep-copy instead).
All fields in this struct should be considered as “private”. Any changes may lead to unexpected behavior.
Fields§
§string: ZyanStringThe string data.
The view internally re-uses the normal string struct to allow casts without any runtime overhead.
Trait Implementations§
Source§impl Clone for ZyanStringView_
impl Clone for ZyanStringView_
Source§fn clone(&self) -> ZyanStringView_
fn clone(&self) -> ZyanStringView_
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more