Skip to main content

EncodedText

Trait EncodedText 

Source
pub trait EncodedText {
    // Required method
    fn as_raw(&self) -> (*const c_void, usize, TextEncoding);
}
Expand description

Trait representing encoded text.

Functions that expect EncodedText may be passed String, &String``, &strrepresenting UTF-8 encoded text. In addition to that, &[u16], [u16], or &[GlyphId], [GlyphId], are interpreted asGlyphId` slices.

To use UTF16 or UTF32 encodings, use as_utf16_unchecked or as_utf32_unchecked.

Required Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl EncodedText for &str

Source§

impl EncodedText for &[u16]

Source§

impl EncodedText for String

Source§

impl<T> EncodedText for &T
where T: EncodedText,

Source§

impl<const N: usize> EncodedText for [u16; N]

Implementors§