pub struct GetContextCallback(/* private fields */);Expand description
Wrapper around CallbackWithContext to provide a default implementation
Implementations§
Source§impl GetContextCallback
impl GetContextCallback
pub fn new(callback: impl Into<GetContextCallback>) -> Self
Methods from Deref<Target = GetContextCallbackInner>§
pub fn js(&self) -> Option<CallbackWithContext<J>>
pub fn rs(&self) -> Option<CallbackWithContext<R>>
pub fn js_unwrap(&self) -> CallbackWithContext<J>
pub fn rs_unwrap(&self) -> CallbackWithContext<R>
pub fn js_inner_owned(&self) -> Option<J>
pub fn rs_inner_owned(&self) -> Option<R>
Sourcepub fn call_with_no_arg(&self)
pub fn call_with_no_arg(&self)
If the function is a rust callback, the argument is supplied, otherwise the javascript function is called without any arguments.
Sourcepub fn call_with_rust_arg(&self, a: A)
pub fn call_with_rust_arg(&self, a: A)
If the function is a rust callback, the argument is supplied, otherwise the javascript function is called without any arguments.
Sourcepub fn call_with_rust_arg_and_return(&self, a: A) -> R
pub fn call_with_rust_arg_and_return(&self, a: A) -> R
If the function is a rust callback, the argument is supplied, otherwise the javascript function is called without any arguments.
Returns the result value
Sourcepub fn call_with_js_arg(&self, a: A)
pub fn call_with_js_arg(&self, a: A)
Calls either underlying callback with the argument supplied
Sourcepub fn call_with_into_js_arg(&self, a: A)
pub fn call_with_into_js_arg(&self, a: A)
Calls either underlying callback with the argument supplied
Sourcepub fn call_with_as_js_arg(&self, a: A)
pub fn call_with_as_js_arg(&self, a: A)
Calls either underlying callback with the argument supplied
Sourcepub fn call_with_into_js_arg_and_return(&self, a: A) -> R
pub fn call_with_into_js_arg_and_return(&self, a: A) -> R
Calls either underlying callback with the argument supplied and returns the resulting value
Trait Implementations§
Source§impl Clone for GetContextCallback
impl Clone for GetContextCallback
Source§fn clone(&self) -> GetContextCallback
fn clone(&self) -> GetContextCallback
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GetContextCallback
impl Debug for GetContextCallback
Source§impl Default for GetContextCallback
impl Default for GetContextCallback
Source§impl Deref for GetContextCallback
impl Deref for GetContextCallback
Source§type Target = Callback<dyn Fn(HtmlCanvasElement) -> Result<WebGl2RenderingContext, WebGlContextError>, Function>
type Target = Callback<dyn Fn(HtmlCanvasElement) -> Result<WebGl2RenderingContext, WebGlContextError>, Function>
The resulting type after dereferencing.
Source§impl<F: Fn(HtmlCanvasElement) -> Result<WebGl2RenderingContext, WebGlContextError> + 'static> From<F> for GetContextCallback
impl<F: Fn(HtmlCanvasElement) -> Result<WebGl2RenderingContext, WebGlContextError> + 'static> From<F> for GetContextCallback
Source§impl From<Function> for GetContextCallback
impl From<Function> for GetContextCallback
Source§impl<F: Fn(HtmlCanvasElement) -> Result<WebGl2RenderingContext, WebGlContextError> + 'static> From<Rc<F>> for GetContextCallback
impl<F: Fn(HtmlCanvasElement) -> Result<WebGl2RenderingContext, WebGlContextError> + 'static> From<Rc<F>> for GetContextCallback
Source§impl Hash for GetContextCallback
impl Hash for GetContextCallback
Source§impl PartialEq for GetContextCallback
impl PartialEq for GetContextCallback
Source§impl PartialOrd for GetContextCallback
impl PartialOrd for GetContextCallback
impl Eq for GetContextCallback
impl StructuralPartialEq for GetContextCallback
Auto Trait Implementations§
impl Freeze for GetContextCallback
impl !RefUnwindSafe for GetContextCallback
impl !Send for GetContextCallback
impl !Sync for GetContextCallback
impl Unpin for GetContextCallback
impl !UnwindSafe for GetContextCallback
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