Struct vulkanalia_sys::StringArray
source · [−]#[repr(transparent)]pub struct StringArray<const N: usize>(_);Expand description
An array containing a null-terminated string.
Equality / Hashing
For the purposes of comparing and hashing array strings, any characters after the first null terminator are ignored. The below example demonstrates this property with two strings that differ in the characters that come after the first null terminators.
let string1 = StringArray::<3>::new([0x61, 0, 0]);
let string2 = StringArray::<3>::new([0x61, 0, 0x61]);
assert_eq!(string1, string2);
let mut hasher1 = DefaultHasher::new();
string1.hash(&mut hasher1);
let mut hasher2 = DefaultHasher::new();
string2.hash(&mut hasher2);
assert_eq!(hasher1.finish(), hasher2.finish());Implementations
Constructs a string array from a character array.
Panics
charactersdoes not contain a null-terminator
Constructs a string array from a byte string.
If the byte string is longer than N - 1, then the byte string will
be truncated to fit inside of the constructed string array (the last
character is reserved for a null terminator). The constructed string
array will always be null-terminated regardless if the byte string is
or is not null-terminated.
Constructs a string array from a borrowed C string.
If the borrowed C string is longer than N - 1, then the borrowed C
string will be truncated to fit inside of the constructed string array
(the last character is reserved for a null terminator).
Constructs a string array from a pointer to a null-terminated string.
If the null-terminated string is longer than N - 1, then the
null-terminated string will be truncated to fit inside of the
constructed string array (the last character is reserved for a null
terminator).
Safety
ptrmust be a pointer to a null-terminated string
Gets the underlying character array for this string array.
Gets this string array as a slice of bytes.
Converts this string array to a UTF-8 string (lossily).
Trait Implementations
Performs the conversion.
Auto Trait Implementations
impl<const N: usize> RefUnwindSafe for StringArray<N>
impl<const N: usize> Send for StringArray<N>
impl<const N: usize> Sync for StringArray<N>
impl<const N: usize> Unpin for StringArray<N>
impl<const N: usize> UnwindSafe for StringArray<N>
Blanket Implementations
Mutably borrows from an owned value. Read more