Skip to main content

Kind

Trait Kind 

Source
pub trait Kind:
    Sealed
    + Copy
    + 'static {
    type C: Copy + 'static;
    type Char: Copy + From<u8> + Into<u32> + PartialEq + 'static;

    const NUL: Self::Char;
    const IS_THIN_NOT_WIDE: bool;

    // Required methods
    fn r2c(c: Self::Char) -> Self::C;
    fn c2r(c: Self::C) -> Self::Char;
    fn chars_from_bytes(b: &[u8]) -> Option<&[Self::Char]>;
    fn chars_to_bytes(c: &[Self::Char]) -> Option<&[u8]>;
    unsafe fn strlen(s: *const Self::C) -> usize;
    unsafe fn strchr(s: *const Self::C, c: Self::C) -> *const Self::C;
    unsafe fn strchrnul(s: *const Self::C, c: Self::C) -> *const Self::C;
}

Required Associated Constants§

Required Associated Types§

Source

type C: Copy + 'static

c_char or wchar_t

Source

type Char: Copy + From<u8> + Into<u32> + PartialEq + 'static

Required Methods§

Source

fn r2c(c: Self::Char) -> Self::C

Source

fn c2r(c: Self::C) -> Self::Char

Source

fn chars_from_bytes(b: &[u8]) -> Option<&[Self::Char]>

Source

fn chars_to_bytes(c: &[Self::Char]) -> Option<&[u8]>

Source

unsafe fn strlen(s: *const Self::C) -> usize

Source

unsafe fn strchr(s: *const Self::C, c: Self::C) -> *const Self::C

Source

unsafe fn strchrnul(s: *const Self::C, c: Self::C) -> *const Self::C

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl Kind for Thin

Source§

const NUL: Self::Char = 0

Source§

const IS_THIN_NOT_WIDE: bool = true

Source§

type C = i8

Source§

type Char = u8

Source§

impl Kind for Wide

Source§

const NUL: Self::Char = 0

Source§

const IS_THIN_NOT_WIDE: bool = false

Source§

type C = i32

Source§

type Char = u32