pub struct CString<'js> { /* private fields */ }
Expand description
Rust representation of a JavaScript C string.
Implementations§
Source§impl<'js> CString<'js>
impl<'js> CString<'js>
Sourcepub fn from_string(string: String<'js>) -> Result<Self>
pub fn from_string(string: String<'js>) -> Result<Self>
Create a new JavaScript C string from a JavaScript string.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the length of this CString
, in bytes (not chars or graphemes).
Trait Implementations§
Auto Trait Implementations§
impl<'js> Freeze for CString<'js>
impl<'js> RefUnwindSafe for CString<'js>
impl<'js> !Send for CString<'js>
impl<'js> !Sync for CString<'js>
impl<'js> Unpin for CString<'js>
impl<'js> !UnwindSafe for CString<'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.
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more