[−][src]Struct ducc::String
An immutable, interned JavaScript string managed by Duktape.
Unlike Rust strings, Duktape strings are CESU-8 (not UTF-8).
Methods
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> ToValue<'ducc> for String<'ducc>
[src]
impl<'ducc> FromValue<'ducc> for String<'ducc>
[src]
impl<'ducc> AsRef<[u8]> for String<'ducc>
[src]
impl<'ducc> Clone for String<'ducc>
[src]
impl<'ducc, T: AsRef<[u8]>> PartialEq<T> for String<'ducc>
[src]
impl<'ducc> Debug for String<'ducc>
[src]
Auto Trait Implementations
impl<'ducc> !Send for String<'ducc>
impl<'ducc> !Sync for String<'ducc>
impl<'ducc> Unpin for String<'ducc>
impl<'ducc> UnwindSafe for String<'ducc>
impl<'ducc> RefUnwindSafe for String<'ducc>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,