pub struct Exports<'js>(/* private fields */);
Expand description
A struct used for setting the value of previously declared exporsts of a module.
Implementations§
Source§impl<'js> Exports<'js>
impl<'js> Exports<'js>
Sourcepub fn export<N: Into<Vec<u8>>, T: IntoJs<'js>>(
&self,
name: N,
value: T,
) -> Result<&Self>
pub fn export<N: Into<Vec<u8>>, T: IntoJs<'js>>( &self, name: N, value: T, ) -> Result<&Self>
Set the value of an exported entry.
Sourcepub fn export_c_str<T: IntoJs<'js>>(
&self,
name: &CStr,
value: T,
) -> Result<&Self>
pub fn export_c_str<T: IntoJs<'js>>( &self, name: &CStr, value: T, ) -> Result<&Self>
Set the value of an exported entry.
This function avoids a possible conversion from a rust string into a CStr
Auto Trait Implementations§
impl<'js> Freeze for Exports<'js>
impl<'js> RefUnwindSafe for Exports<'js>
impl<'js> !Send for Exports<'js>
impl<'js> !Sync for Exports<'js>
impl<'js> Unpin for Exports<'js>
impl<'js> !UnwindSafe for Exports<'js>
Blanket Implementations§
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<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