Skip to main content

WideStringBuffer

Struct WideStringBuffer 

Source
pub struct WideStringBuffer<const N: usize> { /* private fields */ }
Expand description

In-place wide string buffer for stack allocation.

This avoids heap allocation for common path operations.

Implementations§

Source§

impl<const N: usize> WideStringBuffer<N>

Source

pub const fn new() -> Self

Creates an empty buffer.

Source

pub fn from_utf8(s: &str) -> FsResult<Self>

Creates from a UTF-8 string.

Source

pub fn push_utf8(&mut self, s: &str) -> FsResult<()>

Appends a UTF-8 string.

Source

pub fn push_null(&mut self) -> FsResult<()>

Appends a null terminator if there’s room.

Source

pub fn as_slice(&self) -> &[u16]

Returns the buffer as a slice.

Source

pub fn as_slice_with_null(&mut self) -> FsResult<&[u16]>

Returns the buffer as a null-terminated slice (includes the null).

Source

pub fn as_unicode_string(&self) -> UnicodeString

Returns as a UNICODE_STRING.

Source

pub const fn len(&self) -> usize

Returns the length in characters.

Source

pub const fn is_empty(&self) -> bool

Returns true if empty.

Source

pub fn clear(&mut self)

Clears the buffer.

Source

pub const fn capacity(&self) -> usize

Returns capacity in characters.

Trait Implementations§

Source§

impl<const N: usize> Default for WideStringBuffer<N>

Source§

fn default() -> Self

Implements default.

Auto Trait Implementations§

§

impl<const N: usize> Freeze for WideStringBuffer<N>

§

impl<const N: usize> RefUnwindSafe for WideStringBuffer<N>

§

impl<const N: usize> Send for WideStringBuffer<N>

§

impl<const N: usize> Sync for WideStringBuffer<N>

§

impl<const N: usize> Unpin for WideStringBuffer<N>

§

impl<const N: usize> UnsafeUnpin for WideStringBuffer<N>

§

impl<const N: usize> UnwindSafe for WideStringBuffer<N>

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