Struct zstring::ZBytesRef [−][src]
#[repr(transparent)]pub struct ZBytesRef<'a> { /* fields omitted */ }Expand description
Borrows a non-null const pointer to zero-termianted bytes.
The bytes have no enforced encoding.
Because this is a “thin” pointer it’s suitable for direct use with FFI.
Implementations
Turns a NonNull into a ZBytesRef
Safety
- The NonNull must point to a series of bytes that is null-terminated.
pub const fn iter(&self) -> ZBytesRefIter<'a>ⓘNotable traits for ZBytesRefIter<'a>impl<'a> Iterator for ZBytesRefIter<'a> type Item = &'a u8;
pub const fn iter(&self) -> ZBytesRefIter<'a>ⓘNotable traits for ZBytesRefIter<'a>impl<'a> Iterator for ZBytesRefIter<'a> type Item = &'a u8;
impl<'a> Iterator for ZBytesRefIter<'a> type Item = &'a u8;Gets an iterator over the bytes.
The iterator does not return the final null byte.
Gets the full slice this points to, including the null byte.
Caution: This takes linear time to compute the slice length!
Trait Implementations
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more