Struct UnicodeApi

Source
#[repr(C)]
pub struct UnicodeApi {
Show 16 fields pub is_valid: Option<unsafe extern "C" fn(utf8: *const c_char) -> bool>, pub truncate: Option<unsafe extern "C" fn(utf8: *mut c_char)>, pub utf8_encode: Option<unsafe extern "C" fn(utf8: *mut c_char, codepoint: u32) -> *mut c_char>, pub utf8_decode: Option<unsafe extern "C" fn(utf8: *mut *const c_char) -> u32>, pub utf8_num_codepoints: Option<unsafe extern "C" fn(utf8: *const c_char) -> u32>, pub utf8_decode_n: Option<unsafe extern "C" fn(codepoints: *mut u32, n: u32, utf8: *const c_char) -> u32>, pub utf8_to_utf32: Option<unsafe extern "C" fn(utf8: *const c_char, ta: *mut TempAllocatorI) -> *mut u32>, pub utf8_to_utf32_n: Option<unsafe extern "C" fn(utf8: *const c_char, n: u32, ta: *mut TempAllocatorI) -> *mut u32>, pub utf32_to_utf8: Option<unsafe extern "C" fn(utf32: *const u32, ta: *mut TempAllocatorI) -> *mut c_char>, pub utf32_to_utf8_n: Option<unsafe extern "C" fn(utf32: *const u32, n: u32, ta: *mut TempAllocatorI) -> *mut c_char>, pub utf16_encode: Option<unsafe extern "C" fn(utf16: *mut u16, codepoint: u32) -> *mut u16>, pub utf16_decode: Option<unsafe extern "C" fn(utf16: *mut *const u16) -> u32>, pub utf8_to_utf16: Option<unsafe extern "C" fn(utf8: *const c_char, ta: *mut TempAllocatorI) -> *mut u16>, pub utf8_to_utf16_n: Option<unsafe extern "C" fn(utf8: *const c_char, n: u32, ta: *mut TempAllocatorI) -> *mut u16>, pub utf16_to_utf8: Option<unsafe extern "C" fn(utf16: *const u16, ta: *mut TempAllocatorI) -> *mut c_char>, pub utf16_to_utf8_n: Option<unsafe extern "C" fn(utf16: *const u16, n: u32, ta: *mut TempAllocatorI) -> *mut c_char>,
}

Fields§

§is_valid: Option<unsafe extern "C" fn(utf8: *const c_char) -> bool>§truncate: Option<unsafe extern "C" fn(utf8: *mut c_char)>§utf8_encode: Option<unsafe extern "C" fn(utf8: *mut c_char, codepoint: u32) -> *mut c_char>§utf8_decode: Option<unsafe extern "C" fn(utf8: *mut *const c_char) -> u32>§utf8_num_codepoints: Option<unsafe extern "C" fn(utf8: *const c_char) -> u32>§utf8_decode_n: Option<unsafe extern "C" fn(codepoints: *mut u32, n: u32, utf8: *const c_char) -> u32>§utf8_to_utf32: Option<unsafe extern "C" fn(utf8: *const c_char, ta: *mut TempAllocatorI) -> *mut u32>§utf8_to_utf32_n: Option<unsafe extern "C" fn(utf8: *const c_char, n: u32, ta: *mut TempAllocatorI) -> *mut u32>§utf32_to_utf8: Option<unsafe extern "C" fn(utf32: *const u32, ta: *mut TempAllocatorI) -> *mut c_char>§utf32_to_utf8_n: Option<unsafe extern "C" fn(utf32: *const u32, n: u32, ta: *mut TempAllocatorI) -> *mut c_char>§utf16_encode: Option<unsafe extern "C" fn(utf16: *mut u16, codepoint: u32) -> *mut u16>§utf16_decode: Option<unsafe extern "C" fn(utf16: *mut *const u16) -> u32>§utf8_to_utf16: Option<unsafe extern "C" fn(utf8: *const c_char, ta: *mut TempAllocatorI) -> *mut u16>§utf8_to_utf16_n: Option<unsafe extern "C" fn(utf8: *const c_char, n: u32, ta: *mut TempAllocatorI) -> *mut u16>§utf16_to_utf8: Option<unsafe extern "C" fn(utf16: *const u16, ta: *mut TempAllocatorI) -> *mut c_char>§utf16_to_utf8_n: Option<unsafe extern "C" fn(utf16: *const u16, n: u32, ta: *mut TempAllocatorI) -> *mut c_char>

Implementations§

Source§

impl UnicodeApi

Source

pub unsafe fn is_valid(&self, utf8: *const c_char) -> bool

Source

pub unsafe fn truncate(&self, utf8: *mut c_char)

Source

pub unsafe fn utf8_encode( &self, utf8: *mut c_char, codepoint: u32, ) -> *mut c_char

Source

pub unsafe fn utf8_decode(&self, utf8: *mut *const c_char) -> u32

Source

pub unsafe fn utf8_num_codepoints(&self, utf8: *const c_char) -> u32

Source

pub unsafe fn utf8_decode_n( &self, codepoints: *mut u32, n: u32, utf8: *const c_char, ) -> u32

Source

pub unsafe fn utf8_to_utf32( &self, utf8: *const c_char, ta: *mut TempAllocatorI, ) -> *mut u32

Source

pub unsafe fn utf8_to_utf32_n( &self, utf8: *const c_char, n: u32, ta: *mut TempAllocatorI, ) -> *mut u32

Source

pub unsafe fn utf32_to_utf8( &self, utf32: *const u32, ta: *mut TempAllocatorI, ) -> *mut c_char

Source

pub unsafe fn utf32_to_utf8_n( &self, utf32: *const u32, n: u32, ta: *mut TempAllocatorI, ) -> *mut c_char

Source

pub unsafe fn utf16_encode(&self, utf16: *mut u16, codepoint: u32) -> *mut u16

Source

pub unsafe fn utf16_decode(&self, utf16: *mut *const u16) -> u32

Source

pub unsafe fn utf8_to_utf16( &self, utf8: *const c_char, ta: *mut TempAllocatorI, ) -> *mut u16

Source

pub unsafe fn utf8_to_utf16_n( &self, utf8: *const c_char, n: u32, ta: *mut TempAllocatorI, ) -> *mut u16

Source

pub unsafe fn utf16_to_utf8( &self, utf16: *const u16, ta: *mut TempAllocatorI, ) -> *mut c_char

Source

pub unsafe fn utf16_to_utf8_n( &self, utf16: *const u16, n: u32, ta: *mut TempAllocatorI, ) -> *mut c_char

Trait Implementations§

Source§

impl Api for UnicodeApi

Source§

impl Clone for UnicodeApi

Source§

fn clone(&self) -> UnicodeApi

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for UnicodeApi

Source§

fn default() -> UnicodeApi

Returns the “default value” for a type. Read more
Source§

impl Copy for UnicodeApi

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.