pub struct CString<'a> { /* private fields */ }
Expand description
§CString
- binary data(.hkx): null-terminated string
- XML:
&str
§C++ Info
- name:
char*
- type_size:
4
(x86)/8
(x86_64) - align:
4
(x86)/8
(x86_64)
§Null representation
- hkx: It will not be written to the binary data.
- XML:
\u{2400}
. - Rust: If it is null then
Option::None
.(To eliminate the risk of always being null ptr by type)
§Deserialization patterns
- hkx(
Vec<u8>
) -> Struct(str
inCow<'_, str>
) => non copy - xml(
String
) -> Struct(str
inCow<'_, str>
) => non copy - json:
String
-> Struct(str
inCow<'_, str>
) => non copy
§Serialization is alloc
Implementations§
Source§impl<'a> CString<'a>
impl<'a> CString<'a>
Sourcepub fn into_inner(self) -> Option<Cow<'a, str>>
pub fn into_inner(self) -> Option<Cow<'a, str>>
Get inner value.
Sourcepub const fn is_null(&self) -> bool
pub const fn is_null(&self) -> bool
Null pointer or not?
This indicates that no binary data was present.
Sourcepub fn should_write_binary(&self) -> bool
pub fn should_write_binary(&self) -> bool
Should the data pointed to by the pointer be written to the binary data or not?
This is an invalid value or not.
Trait Implementations§
Source§impl<'a> Ord for CString<'a>
impl<'a> Ord for CString<'a>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a> PartialOrd for CString<'a>
impl<'a> PartialOrd for CString<'a>
impl<'a> Eq for CString<'a>
impl<'a> StructuralPartialEq for CString<'a>
Auto Trait Implementations§
impl<'a> Freeze for CString<'a>
impl<'a> RefUnwindSafe for CString<'a>
impl<'a> Send for CString<'a>
impl<'a> Sync for CString<'a>
impl<'a> Unpin for CString<'a>
impl<'a> UnwindSafe for CString<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more