[−][src]Struct stdweb::web::html_element::CanvasElement
The HTML <canvas>
element provides an empty graphic zone on which specific JavaScript APIs
can draw (such as Canvas 2D or WebGL).
Methods
impl CanvasElement
[src]
pub fn height(&self) -> u32
[src]
Returns a positive integer reflecting the height HTML attribute of the
pub fn set_height(&self, value: u32)
[src]
Sets a positive integer reflecting the height HTML attribute of the
pub fn width(&self) -> u32
[src]
Returns a positive integer reflecting the width HTML attribute of the
pub fn set_width(&self, value: u32)
[src]
Sets a positive integer reflecting the width HTML attribute of the
pub fn get_context<T: RenderingContext>(&self) -> Result<T, T::Error>
[src]
Returns a drawing context on the canvas, or None if the context identifier is not supported.
pub fn to_data_url(
&self,
mime_type: Option<&str>,
quality: Option<f64>
) -> Result<String, TODO>
[src]
&self,
mime_type: Option<&str>,
quality: Option<f64>
) -> Result<String, TODO>
Returns a data URI containing a representation of the image in the format specified by the type parameter (defaults to PNG). The returned image is in a resolution of 96 dpi.
pub fn to_blob<F: FnOnce(Blob) + 'static>(
&self,
f: F,
mime_type: Option<&str>,
quality: Option<f64>
) -> Result<(), TODO>
[src]
&self,
f: F,
mime_type: Option<&str>,
quality: Option<f64>
) -> Result<(), TODO>
Creates a Blob object representing the image contained in the canvas; this file may be cached on the disk or stored in memory at the discretion of the user agent.
Trait Implementations
impl JsSerialize for CanvasElement
[src]
impl TryFrom<EventTarget> for CanvasElement
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: EventTarget) -> Result<Self, Self::Error>
[src]
impl TryFrom<Node> for CanvasElement
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Node) -> Result<Self, Self::Error>
[src]
impl TryFrom<Element> for CanvasElement
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Element) -> Result<Self, Self::Error>
[src]
impl TryFrom<HtmlElement> for CanvasElement
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: HtmlElement) -> Result<Self, Self::Error>
[src]
impl TryFrom<CanvasElement> for Reference
[src]
type Error = Void
The type returned in the event of a conversion error.
fn try_from(value: CanvasElement) -> Result<Self, Self::Error>
[src]
impl TryFrom<Reference> for CanvasElement
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: Reference) -> Result<Self, Self::Error>
[src]
impl<'_r> TryFrom<&'_r Reference> for CanvasElement
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: &Reference) -> Result<Self, Self::Error>
[src]
impl TryFrom<Value> for CanvasElement
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<Self, Self::Error>
[src]
impl<'_r> TryFrom<&'_r Value> for CanvasElement
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<Self, Self::Error>
[src]
impl InstanceOf for CanvasElement
[src]
fn instance_of(reference: &Reference) -> bool
[src]
impl ReferenceType for CanvasElement
[src]
unsafe fn from_reference_unchecked(reference: Reference) -> Self
[src]
impl IEventTarget for CanvasElement
[src]
fn add_event_listener<T, F>(&self, listener: F) -> EventListenerHandle where
T: ConcreteEvent,
F: FnMut(T) + 'static,
[src]
T: ConcreteEvent,
F: FnMut(T) + 'static,
fn dispatch_event<T: IEvent>(&self, event: &T) -> Result<bool, TODO>
[src]
impl INode for CanvasElement
[src]
fn as_node(&self) -> &Node
[src]
fn append_child<T: INode>(&self, child: &T)
[src]
fn remove_child<T: INode>(&self, child: &T) -> Result<Node, NotFoundError>
[src]
fn clone_node(&self, kind: CloneKind) -> Result<Self, TODO>
[src]
fn contains<T: INode>(&self, node: &T) -> bool
[src]
fn insert_before<T: INode, U: INode>(
&self,
new_node: &T,
reference_node: &U
) -> Result<Node, InsertNodeError>
[src]
&self,
new_node: &T,
reference_node: &U
) -> Result<Node, InsertNodeError>
fn replace_child<T: INode, U: INode>(
&self,
new_child: &T,
old_child: &U
) -> Result<Node, InsertNodeError>
[src]
&self,
new_child: &T,
old_child: &U
) -> Result<Node, InsertNodeError>
fn parent_node(&self) -> Option<Node>
[src]
fn first_child(&self) -> Option<Node>
[src]
fn last_child(&self) -> Option<Node>
[src]
fn next_sibling(&self) -> Option<Node>
[src]
fn node_name(&self) -> String
[src]
fn node_type(&self) -> NodeType
[src]
fn node_value(&self) -> Option<String>
[src]
fn set_node_value(&self, value: Option<&str>)
[src]
fn owner_document(&self) -> Option<Document>
[src]
fn parent_element(&self) -> Option<Element>
[src]
fn previous_sibling(&self) -> Option<Node>
[src]
fn text_content(&self) -> Option<String>
[src]
fn set_text_content(&self, text: &str)
[src]
fn child_nodes(&self) -> NodeList
[src]
fn base_uri(&self) -> String
[src]
fn has_child_nodes(&self) -> bool
[src]
fn is_default_namespace(&self, namespace: &str) -> bool
[src]
fn is_equal_node<T: INode>(&self, node: &T) -> bool
[src]
fn is_same_node<T: INode>(&self, node: &T) -> bool
[src]
fn lookup_prefix(&self, namespace: &str) -> Option<String>
[src]
fn lookup_namespace_uri(&self, prefix: &str) -> Option<String>
[src]
fn normalize(&self)
[src]
impl IElement for CanvasElement
[src]
fn namespace_uri(&self) -> Option<String>
[src]
fn class_list(&self) -> TokenList
[src]
fn has_attribute(&self, name: &str) -> bool
[src]
fn get_attribute(&self, name: &str) -> Option<String>
[src]
fn set_attribute(
&self,
name: &str,
value: &str
) -> Result<(), InvalidCharacterError>
[src]
&self,
name: &str,
value: &str
) -> Result<(), InvalidCharacterError>
fn scroll_top(&self) -> f64
[src]
fn set_scroll_top(&self, value: f64)
[src]
fn scroll_left(&self) -> f64
[src]
fn set_scroll_left(&self, value: f64)
[src]
fn get_attribute_names(&self) -> Vec<String>
[src]
fn remove_attribute(&self, name: &str)
[src]
fn has_attributes(&self) -> bool
[src]
fn closest(&self, selectors: &str) -> Result<Option<Element>, SyntaxError>
[src]
fn set_pointer_capture(&self, pointer_id: i32) -> Result<(), InvalidPointerId>
[src]
fn release_pointer_capture(
&self,
pointer_id: i32
) -> Result<(), InvalidPointerId>
[src]
&self,
pointer_id: i32
) -> Result<(), InvalidPointerId>
fn has_pointer_capture(&self, pointer_id: i32) -> bool
[src]
fn insert_adjacent_html(
&self,
position: InsertPosition,
html: &str
) -> Result<(), InsertAdjacentError>
[src]
&self,
position: InsertPosition,
html: &str
) -> Result<(), InsertAdjacentError>
fn insert_html_before(&self, html: &str) -> Result<(), InsertAdjacentError>
[src]
fn prepend_html(&self, html: &str) -> Result<(), InsertAdjacentError>
[src]
fn append_html(&self, html: &str) -> Result<(), InsertAdjacentError>
[src]
fn insert_html_after(&self, html: &str) -> Result<(), InsertAdjacentError>
[src]
fn slot(&self) -> String
[src]
fn attach_shadow(
&self,
mode: ShadowRootMode
) -> Result<ShadowRoot, AttachShadowError>
[src]
&self,
mode: ShadowRootMode
) -> Result<ShadowRoot, AttachShadowError>
fn shadow_root(&self) -> Option<ShadowRoot>
[src]
impl IHtmlElement for CanvasElement
[src]
fn focus(&self)
[src]
fn blur(&self)
[src]
fn dataset(&self) -> StringMap
[src]
fn get_bounding_client_rect(&self) -> Rect
[src]
fn offset_width(&self) -> i32
[src]
fn offset_height(&self) -> i32
[src]
fn inner_text(&self) -> String
[src]
impl AsRef<Reference> for CanvasElement
[src]
impl From<CanvasElement> for EventTarget
[src]
fn from(value: CanvasElement) -> Self
[src]
impl From<CanvasElement> for Node
[src]
fn from(value: CanvasElement) -> Self
[src]
impl From<CanvasElement> for Element
[src]
fn from(value: CanvasElement) -> Self
[src]
impl From<CanvasElement> for HtmlElement
[src]
fn from(value: CanvasElement) -> Self
[src]
impl From<CanvasElement> for Reference
[src]
fn from(value: CanvasElement) -> Self
[src]
impl Clone for CanvasElement
[src]
fn clone(&self) -> CanvasElement
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Eq for CanvasElement
[src]
impl PartialEq<CanvasElement> for CanvasElement
[src]
fn eq(&self, other: &CanvasElement) -> bool
[src]
fn ne(&self, other: &CanvasElement) -> bool
[src]
impl Debug for CanvasElement
[src]
Auto Trait Implementations
impl Send for CanvasElement
impl Sync for CanvasElement
impl Unpin for CanvasElement
impl UnwindSafe for CanvasElement
impl RefUnwindSafe for CanvasElement
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,