#[repr(transparent)]pub struct String<'js>(_);
Expand description
Rust representation of a javascript string.
Implementations§
source§impl<'js> String<'js>
impl<'js> String<'js>
sourcepub fn into_value(self) -> Value<'js>
pub fn into_value(self) -> Value<'js>
Convert into value
sourcepub fn into_inner(self) -> Value<'js>
pub fn into_inner(self) -> Value<'js>
Returns the underlying super type.
Methods from Deref<Target = Value<'js>>§
sourcepub fn is_undefined(&self) -> bool
pub fn is_undefined(&self) -> bool
Returns if the value is the JavaScript undefined value.
sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Check if the value is a function
sourcepub fn is_constructor(&self) -> bool
pub fn is_constructor(&self) -> bool
Check if the value is a constructor function
sourcepub fn is_exception(&self) -> bool
pub fn is_exception(&self) -> bool
Check if the value is a constructor function
sourcepub fn get<T>(&self) -> Result<T, Error>where
T: FromJs<'js>,
pub fn get<T>(&self) -> Result<T, Error>where T: FromJs<'js>,
Convert from value to specified type
sourcepub unsafe fn ref_string(&self) -> &String<'js>
pub unsafe fn ref_string(&self) -> &String<'js>
sourcepub unsafe fn ref_symbol(&self) -> &Symbol<'js>
pub unsafe fn ref_symbol(&self) -> &Symbol<'js>
sourcepub unsafe fn ref_object(&self) -> &Object<'js>
pub unsafe fn ref_object(&self) -> &Object<'js>
sourcepub unsafe fn ref_function(&self) -> &Function<'js>
pub unsafe fn ref_function(&self) -> &Function<'js>
sourcepub fn as_function(&self) -> Option<&Function<'js>>
pub fn as_function(&self) -> Option<&Function<'js>>
Try reinterprete as Function
sourcepub unsafe fn ref_constructor(&self) -> &Constructor<'js>
pub unsafe fn ref_constructor(&self) -> &Constructor<'js>
Interprete as Constructor
Safety
You should be sure that the value already is of required type before to do it.
sourcepub fn as_constructor(&self) -> Option<&Constructor<'js>>
pub fn as_constructor(&self) -> Option<&Constructor<'js>>
Try reinterprete as Constructor
sourcepub unsafe fn ref_exception(&self) -> &Exception<'js>
pub unsafe fn ref_exception(&self) -> &Exception<'js>
sourcepub fn as_exception(&self) -> Option<&Exception<'js>>
pub fn as_exception(&self) -> Option<&Exception<'js>>
Try reinterprete as Exception
sourcepub unsafe fn ref_big_int(&self) -> &BigInt<'js>
pub unsafe fn ref_big_int(&self) -> &BigInt<'js>
sourcepub fn as_big_int(&self) -> Option<&BigInt<'js>>
pub fn as_big_int(&self) -> Option<&BigInt<'js>>
Try reinterprete as BigInt
Trait Implementations§
source§impl<'js> PartialEq<String<'js>> for String<'js>
impl<'js> PartialEq<String<'js>> for String<'js>
impl<'js> StructuralPartialEq for String<'js>
Auto Trait Implementations§
impl<'js> RefUnwindSafe for String<'js>
impl<'js> !Send for String<'js>
impl<'js> !Sync for String<'js>
impl<'js> Unpin for String<'js>
impl<'js> !UnwindSafe for String<'js>
Blanket Implementations§
source§impl<'js, T> AsProperty<'js, T> for Twhere
T: IntoJs<'js>,
impl<'js, T> AsProperty<'js, T> for Twhere T: IntoJs<'js>,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<'js, T> FromParam<'js> for Twhere
T: FromJs<'js>,
impl<'js, T> FromParam<'js> for Twhere T: FromJs<'js>,
source§fn param_requirement() -> ParamRequirement
fn param_requirement() -> ParamRequirement
The parameters requirements this value requires.
source§fn from_param<'a>(params: &mut ParamsAccessor<'a, 'js>) -> Result<T, Error>
fn from_param<'a>(params: &mut ParamsAccessor<'a, 'js>) -> Result<T, Error>
Convert from a parameter value.