Struct josephine::string::JSString
[−]
[src]
pub struct JSString<'a, C> { /* fields omitted */ }
The type of JS-managed strings in the same zone as compartment C
, with lifetime a
.
Rust is much happier with flat string representations, so we flatten
strings when they come into Rust.
Methods
impl<'a, C> JSString<'a, C>
[src]
fn to_jsstring(self) -> *mut JSString
[src]
fn to_jsflatstring(self) -> *mut JSFlatString
[src]
fn to_jsval(self) -> Value
[src]
fn len(self) -> usize
[src]
fn has_latin1_chars(self) -> bool
[src]
unsafe fn get_latin1_chars(self) -> &'a str
[src]
unsafe fn get_two_byte_chars(self) -> &'a [u16]
[src]
fn contents(self) -> JSStringContents<'a>
[src]
unsafe fn from_jsstring(js_string: *mut JSString) -> JSString<'a, C>
[src]
unsafe fn from_latin1_unchecked<S>(
cx: &'a mut JSContext<S>,
string: &str
) -> JSString<'a, C> where
S: CanAlloc + InCompartment<C>,
[src]
cx: &'a mut JSContext<S>,
string: &str
) -> JSString<'a, C> where
S: CanAlloc + InCompartment<C>,
fn from_latin1<S>(
cx: &'a mut JSContext<S>,
string: &str
) -> Option<JSString<'a, C>> where
S: CanAlloc + InCompartment<C>,
[src]
cx: &'a mut JSContext<S>,
string: &str
) -> Option<JSString<'a, C>> where
S: CanAlloc + InCompartment<C>,
fn from_twobyte<S>(cx: &'a mut JSContext<S>, slice: &[u16]) -> JSString<'a, C> where
S: CanAlloc + InCompartment<C>,
[src]
S: CanAlloc + InCompartment<C>,
fn from_str<S>(cx: &'a mut JSContext<S>, string: &str) -> JSString<'a, C> where
S: CanAlloc + InCompartment<C>,
[src]
S: CanAlloc + InCompartment<C>,
fn clone_in<S, D>(self, cx: &'a mut JSContext<S>) -> JSString<'a, D> where
S: CanAlloc + InCompartment<D>,
[src]
S: CanAlloc + InCompartment<D>,
Trait Implementations
impl<'a, C, D> JSCompartmental<C, D> for JSString<'a, C>
[src]
type ChangeCompartment = JSString<'a, D>
fn is_in_compartment<S>(&self, _cx: &JSContext<S>) -> bool where
S: InCompartment<D>,
[src]
S: InCompartment<D>,
impl<'a, C> Clone for JSString<'a, C>
[src]
fn clone(&self) -> JSString<'a, C>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a, C> Copy for JSString<'a, C>
[src]
impl<'a, C> Display for JSString<'a, C>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'a, C> JSTraceable for JSString<'a, C>
[src]
unsafe fn trace(&self, trc: *mut JSTracer)
[src]
fn as_ptr(&self) -> *const JSTraceable where
Self: Sized,
[src]
Self: Sized,
fn as_mut_ptr(&mut self) -> *mut JSTraceable where
Self: Sized,
[src]
Self: Sized,