Skip to main content

FixedUtf16

Struct FixedUtf16 

Source
pub struct FixedUtf16<const N: usize, E: Utf16ByteOrder> { /* private fields */ }
Expand description

Fixed-width, NUL-padded UTF-16 code units in a specified byte order.

Implementations§

Source§

impl<const N: usize, E: Utf16ByteOrder> FixedUtf16<N, E>

Source

pub const fn new() -> Self

Creates a NUL-filled value.

Source

pub fn try_from_str(value: &str) -> Result<Self, CapacityError>

Encodes a string into fixed-width UTF-16.

Source

pub fn as_bytes(&self) -> &[[u8; 2]; N]

Returns all encoded code-unit bytes, including NUL padding.

Source

pub fn decode( &self, ) -> impl Iterator<Item = Result<char, DecodeUtf16Error>> + '_

Decodes code units up to the first NUL.

Trait Implementations§

Source§

impl<const N: usize, E: Clone + Utf16ByteOrder> Clone for FixedUtf16<N, E>

Source§

fn clone(&self) -> FixedUtf16<N, E>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<const N: usize, E: Copy + Utf16ByteOrder> Copy for FixedUtf16<N, E>

Source§

impl<const N: usize, E: Debug + Utf16ByteOrder> Debug for FixedUtf16<N, E>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize, E: Utf16ByteOrder> Default for FixedUtf16<N, E>

Source§

fn default() -> Self

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

impl<const N: usize, E: Eq + Utf16ByteOrder> Eq for FixedUtf16<N, E>

Source§

impl<const N: usize, E: PartialEq + Utf16ByteOrder> PartialEq for FixedUtf16<N, E>

Source§

fn eq(&self, other: &FixedUtf16<N, E>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<const N: usize, E: PartialEq + Utf16ByteOrder> StructuralPartialEq for FixedUtf16<N, E>

Auto Trait Implementations§

§

impl<const N: usize, E> Freeze for FixedUtf16<N, E>

§

impl<const N: usize, E> RefUnwindSafe for FixedUtf16<N, E>
where E: RefUnwindSafe,

§

impl<const N: usize, E> Send for FixedUtf16<N, E>
where E: Send,

§

impl<const N: usize, E> Sync for FixedUtf16<N, E>
where E: Sync,

§

impl<const N: usize, E> Unpin for FixedUtf16<N, E>
where E: Unpin,

§

impl<const N: usize, E> UnsafeUnpin for FixedUtf16<N, E>

§

impl<const N: usize, E> UnwindSafe for FixedUtf16<N, E>
where E: UnwindSafe,

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, 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.