Struct rust_icu_ustring::UChar
source ·
[−]pub struct UChar { /* fields omitted */ }
Expand description
The implementation of the ICU UChar*
.
While the original type is defined in umachine.h
, most useful functions for manipulating
UChar*
are in fact here.
The first thing you probably want to do is to start from a UTF-8 rust string, produce a UChar.
This is necessarily done with a conversion. See the TryFrom
implementations in this crate
for that.
Implements UChar*
from ICU.
Implementations
Allocates a new UChar with given capacity.
Capacity and size must always be the same with UChar
when used for interacting with
low-level code.
Creates a new crate::UChar from its low-level representation, a buffer pointer and a buffer size.
Does not take ownership of the buffer that was passed in.
DO NOT USE UNLESS YOU HAVE NO OTHER CHOICE.
Safety
rep
must point to an initialized sequence of at least len
UChar
s.
Converts into a zeroed-out string.
This is a very weird ICU API thing, where there apparently exists a zero-terminated
UChar*
.
Returns the constant pointer to the underlying C representation. Intended for use in low-level code.
Returns the underlying representation as a mutable C representation. Caller MUST ensure that the representation won’t be reallocated as result of adding anything to it, and that it is correctly sized, or bad things will happen.
Resizes this string to match new_size.
If the string is made longer, the new space is filled with zeroes.
Returns the equivalent UTF-8 string, useful for debugging.
Trait Implementations
Tries to produce a string from the UTF-8 encoded thing.
This conversion ignores warnings (e.g. warnings about unterminated buffers), since for rust they are not relevant.
Implements u_strFromUTF8
.
Auto Trait Implementations
impl RefUnwindSafe for UChar
impl UnwindSafe for UChar
Blanket Implementations
Mutably borrows from an owned value. Read more