Skip to main content

ExcelString

Struct ExcelString 

Source
pub struct ExcelString { /* private fields */ }
Expand description

Owned UTF-16 payload independent of Excel callback memory.

The box contains payload code units only: no Excel length prefix and no trailing NUL requirement. Arbitrary UTF-16 code units are preserved.

Implementations§

Source§

impl ExcelString

Source

pub fn from_borrowed(value: ExcelValueRef<'_>) -> Result<Self, ConversionError>

Copies callback UTF-16 using ConversionLimits::default.

Source

pub fn from_borrowed_with_limits( value: ExcelValueRef<'_>, limits: &ConversionLimits, ) -> Result<Self, ConversionError>

Copies callback UTF-16 directly, without an intermediate UTF-8 string.

Source§

impl ExcelString

Source

pub fn from_utf16_units(units: impl Into<Box<[u16]>>) -> Self

Owns the supplied UTF-16 code units without validating Unicode scalar values. Conversion limits apply when callback memory is copied, not to semantic strings constructed directly by Rust callers.

Source

pub fn from_utf8(value: &str) -> Self

Encodes valid UTF-8 as owned UTF-16 code units.

Source

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

Returns the exact owned UTF-16 code units, including embedded NULs.

Source

pub const fn len_utf16(&self) -> usize

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

Source

pub const fn is_empty(&self) -> bool

Reports whether the string has no UTF-16 payload units.

Source

pub fn to_string(&self) -> Result<String, Utf16ConversionError>

Strictly decodes the UTF-16 payload.

Source

pub fn to_string_lossy(&self) -> String

Explicitly decodes the payload, replacing unpaired surrogates with the Unicode replacement character.

Trait Implementations§

Source§

impl Clone for ExcelString

Source§

fn clone(&self) -> Self

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 Debug for ExcelString

Source§

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

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

impl Default for ExcelString

Source§

fn default() -> Self

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

impl Eq for ExcelString

Source§

impl From<&str> for ExcelString

Source§

fn from(value: &str) -> Self

Converts to this type from the input type.
Source§

impl From<ExcelStr<'_>> for ExcelString

Source§

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

Converts to this type from the input type.
Source§

impl From<ExcelString> for ReturnText

Source§

fn from(value: ExcelString) -> Self

Converts to this type from the input type.
Source§

impl From<ExcelString> for ExcelReturnValue

Source§

fn from(value: ExcelString) -> Self

Converts to this type from the input type.
Source§

impl From<String> for ExcelString

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl<'call> FromExcel<'call> for ExcelString

Source§

fn from_excel(value: ExcelValueRef<'call>) -> Result<Self, ConversionError>

Converts a callback-borrowed value without invoking Excel coercion. Read more
Source§

impl Hash for ExcelString

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl IntoExcel for ExcelString

Source§

fn into_excel(self) -> Result<ExcelValue, ConversionError>

Produces an owned semantic Excel value suitable for later return planning.
Source§

impl PartialEq for ExcelString

Source§

fn eq(&self, other: &Self) -> bool

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ExcelString

Source§

impl TryFrom<&ExcelString> for String

Source§

type Error = Utf16ConversionError

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

fn try_from(value: &ExcelString) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.