Struct WStrUnits

pub struct WStrUnits<'a> { pub(in ::sys::helpers::wstr) lpwstr: NonNull<u16>, pub(in ::sys::helpers::wstr) lifetime: PhantomData<&'a [u16]> }

A safe iterator over a LPWSTR (aka a pointer to a series of UTF-16 code units terminated by a NULL).

Fields

lpwstr: NonNull<u16>
lifetime: PhantomData<&'a [u16]>

Implementations

impl WStrUnits<'_>

unsafe fn new(lpwstr: *const u16) -> Option<Self>

Creates the iterator. Returns None if lpwstr is null.

SAFETY: lpwstr must point to a null-terminated wide string that lives at least as long as the lifetime of this struct.

fn peek(&self) -> Option<NonZero<u16>>
fn advance_while<P: FnMut(NonZero<u16>) -> bool>(&mut self, predicate: P) -> usize

Advance the iterator while predicate returns true. Returns the number of items it advanced by.

Trait Implementations

impl Iterator for WStrUnits<'_>

type Item = NonZero<u16>;
fn next(&mut self) -> Option<Self::Item>

Auto Trait Implementations

impl<'a> !Send for WStrUnits<'a>

impl<'a> !Sync for WStrUnits<'a>

impl<'a> Freeze for WStrUnits<'a>

impl<'a> RefUnwindSafe for WStrUnits<'a>

impl<'a> Unpin for WStrUnits<'a>

impl<'a> UnsafeUnpin for WStrUnits<'a>

impl<'a> UnwindSafe for WStrUnits<'a>

Blanket Implementations

impl<I> IntoIterator for WStrUnits<'a> where I: Iterator,

type Item = <I as Iterator>::Item;
type IntoIter = I;
fn into_iter(self) -> I

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

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for WStrUnits<'a> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for WStrUnits<'a> where T: ?Sized,

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

impl<T> From<T> for WStrUnits<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> SizeHint for WStrUnits<'a> where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for WStrUnits<'a>

impl<T, U> Into<U> for WStrUnits<'a> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom<U> for WStrUnits<'a> where U: Into<T>,

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

impl<T, U> TryInto<U> for WStrUnits<'a> where U: TryFrom<T>,

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