[][src]Struct ducc::String

pub struct String<'ducc>(_);

An immutable, interned JavaScript string managed by Duktape.

Unlike Rust strings, Duktape strings are CESU-8 (not UTF-8).

Implementations

impl<'ducc> String<'ducc>[src]

pub fn to_string(&self) -> Result<StdString>[src]

Returns a Rust string converted from the Duktape string as long as it can be converted from CESU-8 to UTF-8.

pub fn as_bytes(&self) -> &[u8][src]

Returns the bytes that make up this string, without a trailing nul byte. This is a CESU-8 string.

pub fn as_bytes_with_nul(&self) -> &[u8][src]

Returns the bytes that make up this string, including a trailing nul byte. This is a CESU-8 string.

Trait Implementations

impl<'ducc> AsRef<[u8]> for String<'ducc>[src]

impl<'ducc> Clone for String<'ducc>[src]

impl<'ducc> Debug for String<'ducc>[src]

impl<'ducc> FromValue<'ducc> for String<'ducc>[src]

impl<'ducc, T: AsRef<[u8]>> PartialEq<T> for String<'ducc>[src]

impl<'ducc> ToValue<'ducc> for String<'ducc>[src]

Auto Trait Implementations

impl<'ducc> RefUnwindSafe for String<'ducc>

impl<'ducc> !Send for String<'ducc>

impl<'ducc> !Sync for String<'ducc>

impl<'ducc> Unpin for String<'ducc>

impl<'ducc> UnwindSafe for String<'ducc>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.