pub struct MethodSpec {
pub name: &'static str,
pub doc: &'static str,
pub params: Vec<(&'static str, String, bool)>,
pub returns: Option<String>,
pub call: fn(&dyn JsHost) -> Result<MethodCall, Thrown>,
}Expand description
One method, for the glue and its declarations.
Fields§
§name: &'static strIts JS name.
doc: &'static strDocumentation.
params: Vec<(&'static str, String, bool)>Its parameters: JS names, TypeScript types, and whether each is optional.
returns: Option<String>The TypeScript type of its result; None: nothing (void).
call: fn(&dyn JsHost) -> Result<MethodCall, Thrown>Its call (the arguments converted in the JS call).
Implementations§
Source§impl MethodSpec
impl MethodSpec
Trait Implementations§
Source§impl Clone for MethodSpec
impl Clone for MethodSpec
Auto Trait Implementations§
impl Forget for MethodSpec
impl Freeze for MethodSpec
impl Move for MethodSpec
impl RefUnwindSafe for MethodSpec
impl Send for MethodSpec
impl Sync for MethodSpecwhere
RawVecInner: Sync,
impl Unpin for MethodSpec
impl UnsafeUnpin for MethodSpecwhere
&'static str: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(&'static str, String, bool)>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for MethodSpec
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