pub struct UFormattable<'a> { /* private fields */ }

Implementations§

source§

impl<'a> UFormattable<'a>

source

pub fn try_new<'b>() -> Result<UFormattable<'b>, Error>

Initialize a crate::UFormattable to type UNUM_LONG, value 0 may return error.

Implements ufmt_open.

source

pub fn as_ptr(&self) -> *const UFormattable

source

pub fn is_numeric(&self) -> bool

Returns true if this formattable is numeric.

Implements ufmt_isNumeric

source

pub fn get_type(&self) -> Result<UFormattableType, Error>

Implements ufmt_getType.

Use UFormattable::get_type to verify that the type matches.

source

pub fn get_date(&self) -> Result<UDate, Error>

Implements ufmt_getDate.

Use UFormattable::get_type to verify that the type matches.

source

pub fn get_double(&self) -> Result<f64, Error>

Implements ufmt_getDouble.

Use UFormattable::get_type to verify that the type matches.

source

pub fn get_i32(&self) -> Result<i32, Error>

Implements ufmt_getLong.

Use UFormattable::get_type to verify that the type matches.

source

pub fn get_i64(&self) -> Result<i64, Error>

Implements ufmt_getInt64.

Use UFormattable::get_type to verify that the type matches.

source

pub fn get_array_length(&self) -> Result<i32, Error>

Implements ufmt_getArrayLength.

Use UFormattable::get_type to verify that the type matches.

source

pub fn get_ustring(&self) -> Result<UChar, Error>

source

pub fn get_str(&self) -> Result<String, Error>

Implements ufmt_getUChars

source

pub fn get_array_item_by_index( &'a self, index: i32 ) -> Result<UFormattable<'a>, Error>

Use UFormattable::get_type to ensure that this formattable is an array before using this method. Otherwise you will get an error. The lifetime of the resulting formattable is tied to this one.

Implements ufmt_getArrayItemByIndex

source

pub fn get_dec_num_chars(&self) -> Result<String, Error>

Implements ufmt_getDecNumChars

Trait Implementations§

source§

impl<'a> Debug for UFormattable<'a>

source§

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

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

impl<'a> Drop for UFormattable<'a>

source§

fn drop(&mut self)

Implements ufmt_close.

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for UFormattable<'a>

§

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

§

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

§

impl<'a> Unpin for UFormattable<'a>

§

impl<'a> UnwindSafe for UFormattable<'a>

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

§

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

§

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.