Skip to main content

OffscreenCanvasMethods

pub trait OffscreenCanvasMethods<D>
where D: DomTypes,
{ // Required methods fn Width(&self) -> u64; fn SetWidth(&self, cx: &mut JSContext, value: u64); fn Height(&self) -> u64; fn SetHeight(&self, cx: &mut JSContext, value: u64); fn GetContext( &self, cx: &mut JSContext, contextId: OffscreenRenderingContextId, options: Handle<'_, Value>, ) -> Result<Option<OffscreenCanvasRenderingContext2DOrImageBitmapRenderingContextOrWebGLRenderingContextOrWebGL2RenderingContext<D>>, Error>; fn TransferToImageBitmap( &self, cx: &mut JSContext, ) -> Result<Root<Dom<<D as DomTypes>::ImageBitmap>>, Error>; fn ConvertToBlob( &self, cx: &mut JSContext, options: &ImageEncodeOptions, ) -> Rc<<D as DomTypes>::Promise>; fn Constructor( cx: &mut JSContext, global: &<D as DomTypes>::GlobalScope, proto: Option<Handle<'_, *mut JSObject>>, width: u64, height: u64, ) -> Result<Root<Dom<<D as DomTypes>::OffscreenCanvas>>, Error>; }

Required Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§