[][src]Struct stdweb::web::html_element::ImageElement

pub struct ImageElement(_);

The HTML image element is used to manipulate the layout and presentation of <img> elements.

(JavaScript docs)

Methods

impl ImageElement[src]

pub fn new() -> ImageElement[src]

Constructs a new ImageElement.

(JavaScript docs)

pub fn with_size(width: u32, height: u32) -> ImageElement[src]

Constructs a new ImageElement with the given width and height.

(JavaScript docs)

pub fn alt(&self) -> String[src]

Returns the HTML alt attribute, representing the fallback context for the image.

(JavaScript docs)

pub fn set_alt(&self, value: &str)[src]

Sets the HTML alt attribute, representing the fallback context for the image.

(JavaScript docs)

pub fn complete(&self) -> bool[src]

Returns true if the browser has finished fetching the image, whether successful or not. It also return true if the image has no src value.

(JavaScript docs)

pub fn cross_origin(&self) -> CrossOriginSetting[src]

Returns the Cross-Origin Resource Sharing (CORS) setting for the image.

(JavaScript docs)

pub fn set_cross_origin(&self, value: CrossOriginSetting)[src]

Sets the Cross-Origin Resource Sharing (CORS) setting for the image.

(JavaScript docs)

pub fn height(&self) -> u32[src]

Returns the the rendered height of the image in CSS pixels.

(JavaScript docs)

pub fn set_height(&self, value: u32)[src]

Sets the the rendered height of the image in CSS pixels.

(JavaScript docs)

pub fn is_map(&self) -> bool[src]

Indicates whether the image is part of a server-side image map.

(JavaScript docs)

pub fn set_is_map(&self, value: bool)[src]

Sets whether the image is part of a server-side image map.

(JavaScript docs)

pub fn natural_height(&self) -> Option<u32>[src]

Returns the intrinsic height of the image in CSS pixels, if it is available.

(JavaScript docs)

pub fn natural_width(&self) -> Option<u32>[src]

Returns the intrinsic width of the image in CSS pixels, if it is available.

(JavaScript docs)

pub fn src(&self) -> String[src]

Returns the full URL of the image, including the base URI.

(JavaScript docs)

pub fn set_src(&self, value: &str)[src]

Sets the full URL of the image, including the base URI.

(JavaScript docs)

pub fn use_map(&self) -> String[src]

Returns the usemap HTML attribute, containing a partial URL of a map element.

(JavaScript docs)

pub fn set_use_map(&self, value: &str)[src]

Sets the usemap HTML attribute, containing a partial URL of a map element.

(JavaScript docs)

pub fn width(&self) -> u32[src]

Returns the rendered width of the image in CSS pixels.

(JavaScript docs)

pub fn set_width(&self, value: u32)[src]

Sets the rendered width of the image in CSS pixels.

(JavaScript docs)

Trait Implementations

impl JsSerialize for ImageElement[src]

impl TryFrom<EventTarget> for ImageElement[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Node> for ImageElement[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Element> for ImageElement[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<HtmlElement> for ImageElement[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<ImageElement> for Reference[src]

type Error = Void

The type returned in the event of a conversion error.

impl TryFrom<Reference> for ImageElement[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Reference> for ImageElement[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Value> for ImageElement[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Value> for ImageElement[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl InstanceOf for ImageElement[src]

impl ReferenceType for ImageElement[src]

impl IEventTarget for ImageElement[src]

impl INode for ImageElement[src]

impl IElement for ImageElement[src]

impl IHtmlElement for ImageElement[src]

impl AsRef<Reference> for ImageElement[src]

impl From<ImageElement> for EventTarget[src]

impl From<ImageElement> for Node[src]

impl From<ImageElement> for Element[src]

impl From<ImageElement> for HtmlElement[src]

impl From<ImageElement> for Reference[src]

impl Clone for ImageElement[src]

impl Eq for ImageElement[src]

impl PartialEq<ImageElement> for ImageElement[src]

impl Debug for ImageElement[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]