pub struct HtmlCanvas2DPainter {
height: f32,
width: f32,
context: CanvasRenderingContext2d,
hits_only: bool,
}
Fields§
§height: f32
§width: f32
§context: CanvasRenderingContext2d
§hits_only: bool
Implementations§
Source§impl HtmlCanvas2DPainter
impl HtmlCanvas2DPainter
pub fn new( context: CanvasRenderingContext2d, hits_only: bool, ) -> Result<HtmlCanvas2DPainter, KeyPaintError>
fn set_up_context_defaults(context: &CanvasRenderingContext2d)
fn fill_multiline_text( &mut self, bbox: &BoundingBox, lines: &'static [&'static str], colour: &str, ) -> Result<(), KeyPaintError>
fn draw_filled_stroked_rect(&self, x: f64, y: f64, w: f64, h: f64)
Trait Implementations§
Source§impl From<HtmlCanvas2DPainter> for JsValue
impl From<HtmlCanvas2DPainter> for JsValue
Source§fn from(value: HtmlCanvas2DPainter) -> Self
fn from(value: HtmlCanvas2DPainter) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for HtmlCanvas2DPainter
impl FromWasmAbi for HtmlCanvas2DPainter
Source§impl IntoWasmAbi for HtmlCanvas2DPainter
impl IntoWasmAbi for HtmlCanvas2DPainter
Source§impl KeyPainter for HtmlCanvas2DPainter
impl KeyPainter for HtmlCanvas2DPainter
Source§impl RefFromWasmAbi for HtmlCanvas2DPainter
impl RefFromWasmAbi for HtmlCanvas2DPainter
Source§type Anchor = RcRef<HtmlCanvas2DPainter>
type Anchor = RcRef<HtmlCanvas2DPainter>
The type that holds the reference to
Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl TryFromJsValue for HtmlCanvas2DPainter
impl TryFromJsValue for HtmlCanvas2DPainter
Source§impl VectorFromWasmAbi for HtmlCanvas2DPainter
impl VectorFromWasmAbi for HtmlCanvas2DPainter
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[HtmlCanvas2DPainter]>
Source§impl VectorIntoWasmAbi for HtmlCanvas2DPainter
impl VectorIntoWasmAbi for HtmlCanvas2DPainter
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[HtmlCanvas2DPainter]>) -> Self::Abi
Source§impl WasmDescribe for HtmlCanvas2DPainter
impl WasmDescribe for HtmlCanvas2DPainter
impl SupportsConstructor for HtmlCanvas2DPainter
impl SupportsInstanceProperty for HtmlCanvas2DPainter
impl SupportsStaticProperty for HtmlCanvas2DPainter
Auto Trait Implementations§
impl Freeze for HtmlCanvas2DPainter
impl RefUnwindSafe for HtmlCanvas2DPainter
impl !Send for HtmlCanvas2DPainter
impl !Sync for HtmlCanvas2DPainter
impl Unpin for HtmlCanvas2DPainter
impl UnwindSafe for HtmlCanvas2DPainter
Blanket Implementations§
§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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
§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
§impl<T> ConvUtil for T
impl<T> ConvUtil for T
§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.§impl<Src> TryFrom<Src> for Src
impl<Src> TryFrom<Src> for Src
§impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
§impl<Src> ValueFrom<Src> for Src
impl<Src> ValueFrom<Src> for Src
§fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
Convert the given value into an exactly equivalent representation.
§impl<Src, Dst> ValueInto<Dst> for Srcwhere
Dst: ValueFrom<Src>,
impl<Src, Dst> ValueInto<Dst> for Srcwhere
Dst: ValueFrom<Src>,
§fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
Convert the subject into an exactly equivalent representation.