Skip to main content

ExcelStr

Struct ExcelStr 

Source
pub struct ExcelStr<'call> { /* private fields */ }
Expand description

Borrowed UTF-16 code units. No Unicode conversion is performed.

ⓘ
use excel_api::ExcelStr;
fn require_send<T: Send>() {}
require_send::<ExcelStr<'static>>();
ⓘ
use excel_api::ExcelStr;
fn require_sync<T: Sync>() {}
require_sync::<ExcelStr<'static>>();
ⓘ
use excel_api::ExcelStr;
fn require_clone<T: Clone>() {}
require_clone::<ExcelStr<'static>>();

Implementations§

Source§

impl<'call> ExcelStr<'call>

Source

pub unsafe fn from_counted_direct( counted: &'call XCHAR, ) -> Result<Self, DecodeError>

Parses a registered counted direct UTF-16 argument.

§Safety

counted must be aligned, readable, and immutable for 'call. It must contain a readable length prefix followed by that many code units.

Source

pub unsafe fn from_null_terminated_direct( terminated: &'call XCHAR, ) -> Result<Self, DecodeError>

Parses a registered null-terminated direct UTF-16 argument.

Scanning is bounded by Excel’s 32,767-code-unit string limit.

§Safety

terminated must be aligned, readable, and immutable for 'call through the first NUL or through index 32,767 inclusive.

Source

pub const fn len(&self) -> usize

Returns the number of UTF-16 code units, not Unicode scalar values.

Source

pub const fn is_empty(&self) -> bool

Returns whether the borrowed payload contains no UTF-16 code units.

Source

pub fn as_utf16(&self) -> &'call [u16]

Returns the exact UTF-16 payload, excluding a prefix or terminator.

Trait Implementations§

Source§

impl<'call> Debug for ExcelStr<'call>

Source§

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

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

impl From<ExcelStr<'_>> for ExcelString

Source§

fn from(value: ExcelStr<'_>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'call> !Send for ExcelStr<'call>

§

impl<'call> !Sync for ExcelStr<'call>

§

impl<'call> Freeze for ExcelStr<'call>

§

impl<'call> RefUnwindSafe for ExcelStr<'call>

§

impl<'call> Unpin for ExcelStr<'call>

§

impl<'call> UnsafeUnpin for ExcelStr<'call>

§

impl<'call> UnwindSafe for ExcelStr<'call>

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.