Struct silkenweb::elements::html::Img

source ·
pub struct Img<Dom: Dom = DefaultDom, Mutability = Mut>(/* private fields */);
Expand description

The HTML img element

The HTML <img> element embeds an image into the document.

Implementations§

source§

impl<Dom: Dom> Img<Dom>

source

pub fn new() -> Self

Construct with no attributes set.

source

pub fn freeze(self) -> Img<Dom, Const>

Freeze self, making it immutable.

source

pub fn alt<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The alt attribute

Defines an alternative text description of the image.

Note: Browsers do not always display images. For example:

  • Non-visual browsers (such as those used by people with visual impairments) > * The user chooses not to display images (saving bandwidth, privacy reasons) > * The image is invalid or an unsupported type > * In these cases, the browser may replace the image with the text in the element’s alt attribute. For these reasons and others, provide a useful value for alt whenever possible.

Omitting alt altogether indicates that the image is a key part of the content and no textual equivalent is available. Setting this attribute to an empty string (alt=“”) indicates that this image is not a key part of the content (it’s decoration or a tracking pixel), and that non-visual browsers may omit it from rendering. Visual browsers will also hide the broken image icon if the alt is empty and the image failed to display.

This attribute is also used when copying and pasting the image to text, or saving a linked image to a bookmark.

source

pub fn crossorigin<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The crossorigin attribute

Indicates if the fetching of the image must be done using a CORS request. Image data from a CORS-enabled image returned from a CORS request can be reused in the <canvas> element without being marked “tainted”.

If the crossorigin attribute is not specified, then a non-CORS request is sent (without the Origin request header), and the browser marks the image as tainted and restricts access to its image data, preventing its usage in <canvas> elements.

If the crossorigin attribute is specified, then a CORS request is sent (with the Origin request header); but if the server does not opt into allowing cross-origin access to the image data by the origin site (by not sending any Access-Control-Allow-Origin response header, or by not including the site’s origin in any Access-Control-Allow-Origin response header it does send), then the browser marks the image as tainted and restricts access to its image data, preventing its usage in <canvas> elements.

Allowed values:

  • anonymous: A CORS request is sent with credentials omitted (that is, no cookies, X.509 certificates, or Authorization request header).
  • use-credentials: The CORS request is sent with any credentials included (that is, cookies, X.509 certificates, and the Authorization request header). If the server does not opt into sharing credentials with the origin site (by sending back the Access-Control-Allow-Credentials: true response header), then the browser marks the image as tainted and restricts access to its image data.

If the attribute has an invalid value, browsers handle it as if the anonymous value was used.

source

pub fn decoding<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The decoding attribute

Provides an image decoding hint to the browser. Allowed values:

  • sync: Decode the image synchronously, for atomic presentation with other content.
  • async: Decode the image asynchronously, to reduce delay in presenting other content.
  • auto: Default: no preference for the decoding mode. The browser decides what is best for the user.
source

pub fn height<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The height attribute

The intrinsic height of the image, in pixels. Must be an integer without a unit.

source

pub fn ismap<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<bool>,

The ismap attribute

Indicates that the image is part of a server-side map. If so, the coordinates where the user clicked on the image are sent to the server.

Note: This attribute is allowed only if the <img> element is a descendant of an <a> element with a valid href attribute. This gives users without pointing devices a fallback destination.

source

pub fn loading<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The loading attribute

Indicates how the browser should load the image:

  • eager: Loads the image immediately, regardless of whether or not the image is currently within the visible viewport (this is the default value).
  • lazy: Defers loading the image until it reaches a calculated distance from the viewport, as defined by the browser. The intent is to avoid the network and storage bandwidth needed to handle the image until it’s reasonably certain that it will be needed. This generally improves the performance of the content in most typical use cases.

Note: Loading is only deferred when JavaScript is enabled. This is an anti-tracking measure, because if a user agent supported lazy loading when scripting is disabled, it would still be possible for a site to track a user’s approximate scroll position throughout a session, by strategically placing images in a page’s markup such that a server can track how many images are requested and when.

source

pub fn sizes<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The sizes attribute

One or more strings separated by commas, indicating a set of source sizes. Each source size consists of:

  • A media condition. This must be omitted for the last item in the list.
  • A source size value.

Media Conditions describe properties of the viewport, not of the image. For example, (max-height: 500px) 1000px proposes to use a source of 1000px width, if the viewport is not higher than 500px.

Source size values specify the intended display size of the image. User agents use the current source size to select one of the sources supplied by the srcset attribute, when those sources are described using width (w) descriptors. The selected source size affects the intrinsic size of the image (the image’s display size if no CSS styling is applied). If the srcset attribute is absent, or contains no values with a width descriptor, then the sizes attribute has no effect.

source

pub fn src<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The src attribute

The image URL. Mandatory for the <img> element. On browsers supporting srcset, src is treated like a candidate image with a pixel density descriptor 1x, unless an image with this pixel density descriptor is already defined in srcset, or unless srcset contains w descriptors.

source

pub fn srcset<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The srcset attribute

One or more strings separated by commas, indicating possible image sources for the user agent to use. Each string is composed of:

  • A URL to an image
  • Optionally, whitespace followed by one of:
  • A width descriptor (a positive integer directly followed by w). The width descriptor is divided by the source size given in the sizes attribute to calculate the effective pixel density.
  • A pixel density descriptor (a positive floating point number directly followed by x).
  • If no descriptor is specified, the source is assigned the default descriptor of 1x.

It is incorrect to mix width descriptors and pixel density descriptors in the same srcset attribute. Duplicate descriptors (for instance, two sources in the same srcset which are both described with 2x) are also invalid.

The user agent selects any of the available sources at its discretion. This provides them with significant leeway to tailor their selection based on things like user preferences or bandwidth conditions. See our Responsive images tutorial for an example.

source

pub fn width<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The width attribute

The intrinsic width of the image in pixels. Must be an integer without a unit.

source

pub fn usemap<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The usemap attribute

The partial URL (starting with #) of an image map associated with the element.

Note: You cannot use this attribute if the <img> element is inside an <a> or <button> element.

source§

impl<InitParam, Dom> Img<Template<InitParam, Dom>>
where Dom: InstantiableDom, InitParam: 'static,

source

pub fn on_instantiate( self, f: impl 'static + Fn(Img<Dom>, &InitParam) -> Img<Dom> ) -> Self

source§

impl<InitParam, Dom> Img<Template<InitParam, Dom>, Const>
where Dom: InstantiableDom, InitParam: 'static,

source

pub fn instantiate(&self, param: &InitParam) -> Img<Dom>

Trait Implementations§

source§

impl<Dom: Dom> AriaElement for Img<Dom>

source§

fn role<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The ARIA role attribute
source§

fn aria_activedescendant<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-activedescendant Attribute Read more
source§

fn aria_atomic<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The ARIA aria-atomic Attribute Read more
source§

fn aria_autocomplete<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-autocomplete Attribute Read more
source§

fn aria_braillelabel<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-braillelabel Attribute Read more
source§

fn aria_brailleroledescription<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

source§

fn aria_busy<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The ARIA aria-busy Attribute Read more
source§

fn aria_checked<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The ARIA aria-checked Attribute Read more
source§

fn aria_colcount<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<i64>,

The ARIA aria-colcount Attribute Read more
source§

fn aria_colindex<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<u64>,

The ARIA aria-colindex Attribute Read more
source§

fn aria_colindextext<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-colindextext Attribute Read more
source§

fn aria_colspan<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<u64>,

The ARIA aria-colspan Attribute Read more
source§

fn aria_controls<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-controls Attribute Read more
source§

fn aria_current<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The ARIA aria-current Attribute Read more
source§

fn aria_describedby<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-describedby Attribute Read more
source§

fn aria_description<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-description Attribute Read more
source§

fn aria_details<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The ARIA aria-details Attribute Read more
source§

fn aria_disabled<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-disabled Attribute Read more
source§

fn aria_errormessage<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-errormessage Attribute Read more
source§

fn aria_expanded<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-expanded Attribute Read more
source§

fn aria_flowto<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The ARIA aria-flowto Attribute Read more
source§

fn aria_haspopup<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-haspopup Attribute Read more
source§

fn aria_hidden<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The ARIA aria-hidden Attribute Read more
source§

fn aria_invalid<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The ARIA aria-invalid Attribute Read more
source§

fn aria_keyshortcuts<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-keyshortcuts Attribute Read more
source§

fn aria_label<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The ARIA aria-label Attribute Read more
source§

fn aria_labelledby<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-labelledby Attribute Read more
source§

fn aria_level<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<u64>,

The ARIA aria-level Attribute Read more
source§

fn aria_live<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The ARIA aria-live Attribute Read more
source§

fn aria_modal<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The ARIA aria-modal Attribute Read more
source§

fn aria_multiline<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-multiline Attribute Read more
source§

fn aria_multiselectable<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-multiselectable Attribute Read more
source§

fn aria_orientation<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-orientation Attribute Read more
source§

fn aria_owns<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The ARIA aria-owns Attribute Read more
source§

fn aria_placeholder<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-placeholder Attribute Read more
source§

fn aria_posinset<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<u64>,

The ARIA aria-posinset Attribute Read more
source§

fn aria_pressed<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The ARIA aria-pressed Attribute Read more
source§

fn aria_readonly<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-readonly Attribute Read more
source§

fn aria_relevant<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-relevant Attribute Read more
source§

fn aria_required<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-required Attribute Read more
source§

fn aria_roledescription<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-roledescription Attribute Read more
source§

fn aria_rowcount<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<i64>,

The ARIA aria-rowcount Attribute Read more
source§

fn aria_rowindex<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<u64>,

The ARIA aria-rowindex Attribute Read more
source§

fn aria_rowindextext<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-rowindextext Attribute Read more
source§

fn aria_rowspan<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<u64>,

The ARIA aria-rowspan Attribute Read more
source§

fn aria_selected<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-selected Attribute Read more
source§

fn aria_setsize<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<i64>,

The ARIA aria-setsize Attribute Read more
source§

fn aria_sort<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The ARIA aria-sort Attribute Read more
source§

fn aria_valuemax<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<f64>,

The ARIA aria-valuemax Attribute Read more
source§

fn aria_valuemin<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<f64>,

The ARIA aria-valuemin Attribute Read more
source§

fn aria_valuenow<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<f64>,

The ARIA aria-valuenow Attribute Read more
source§

fn aria_valuetext<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The ARIA aria-valuetext Attribute Read more
source§

impl<Dom: Dom> Default for Img<Dom>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<Dom> Display for Img<Dom, Const>
where Dom: Dom,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Dom: Dom> Element for Img<Dom>

§

type Dom = Dom

§

type DomElement = HtmlImageElement

source§

fn class<'a, T>(self, class: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: 'a + AsRef<str>,

Add a class to the element. Read more
source§

fn classes<'a, T, Iter>( self, classes: impl RefSignalOrValue<'a, Item = Iter> ) -> Self
where T: 'a + AsRef<str>, Iter: 'a + IntoIterator<Item = T>,

Set the classes on an element Read more
source§

fn attribute<'a>( self, name: &str, value: impl RefSignalOrValue<'a, Item = impl Attribute> ) -> Self

Set an attribute Read more
source§

fn style_property<'a>( self, name: impl Into<String>, value: impl RefSignalOrValue<'a, Item = impl AsRef<str> + 'a> ) -> Self

Set an inline style property Read more
source§

fn effect(self, f: impl FnOnce(&Self::DomElement) + 'static) -> Self

Apply an effect after the next render. Read more
source§

fn effect_signal<T: 'static>( self, sig: impl Signal<Item = T> + 'static, f: impl Fn(&Self::DomElement, T) + Clone + 'static ) -> Self

Apply an effect after the next render each time a signal yields a new value.
source§

fn map_element(self, f: impl FnOnce(&Self::DomElement) + 'static) -> Self

Map a function over the element.
source§

fn map_element_signal<T: 'static>( self, sig: impl Signal<Item = T> + 'static, f: impl Fn(&Self::DomElement, T) + Clone + 'static ) -> Self

Map a function over the element each time a signal changes.
source§

fn handle(&self) -> ElementHandle<Self::Dom, Self::DomElement>

Get a handle to the element. Read more
source§

fn spawn_future(self, future: impl Future<Output = ()> + 'static) -> Self

Spawn a future on the element. Read more
source§

fn on(self, name: &'static str, f: impl FnMut(JsValue) + 'static) -> Self

Register an event handler. Read more
source§

impl<Dom: Dom> ElementEvents for Img<Dom>

source§

fn on_animationcancel( self, f: impl FnMut(AnimationEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_animationend( self, f: impl FnMut(AnimationEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_animationiteration( self, f: impl FnMut(AnimationEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_animationstart( self, f: impl FnMut(AnimationEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_auxclick( self, f: impl FnMut(MouseEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_blur(self, f: impl FnMut(FocusEvent, Self::DomElement) + 'static) -> Self

source§

fn on_click(self, f: impl FnMut(MouseEvent, Self::DomElement) + 'static) -> Self

source§

fn on_compositionend( self, f: impl FnMut(CompositionEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_compositionstart( self, f: impl FnMut(CompositionEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_compositionupdate( self, f: impl FnMut(CompositionEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_contextmenu( self, f: impl FnMut(MouseEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_dblclick( self, f: impl FnMut(MouseEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_focusin( self, f: impl FnMut(FocusEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_focusout( self, f: impl FnMut(FocusEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_focus(self, f: impl FnMut(FocusEvent, Self::DomElement) + 'static) -> Self

source§

fn on_fullscreenchange( self, f: impl FnMut(Event, Self::DomElement) + 'static ) -> Self

source§

fn on_fullscreenerror( self, f: impl FnMut(Event, Self::DomElement) + 'static ) -> Self

source§

fn on_gotpointercapture( self, f: impl FnMut(PointerEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_keydown( self, f: impl FnMut(KeyboardEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_keyup( self, f: impl FnMut(KeyboardEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_lostpointercapture( self, f: impl FnMut(PointerEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_mousedown( self, f: impl FnMut(MouseEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_mouseenter( self, f: impl FnMut(MouseEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_mouseleave( self, f: impl FnMut(MouseEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_mousemove( self, f: impl FnMut(MouseEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_mouseout( self, f: impl FnMut(MouseEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_mouseover( self, f: impl FnMut(MouseEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_mouseup( self, f: impl FnMut(MouseEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_pointercancel( self, f: impl FnMut(PointerEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_pointerdown( self, f: impl FnMut(PointerEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_pointerenter( self, f: impl FnMut(PointerEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_pointerleave( self, f: impl FnMut(PointerEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_pointermove( self, f: impl FnMut(PointerEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_pointerout( self, f: impl FnMut(PointerEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_pointerover( self, f: impl FnMut(PointerEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_pointerrawupdate( self, f: impl FnMut(PointerEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_pointerup( self, f: impl FnMut(PointerEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_transitioncancel( self, f: impl FnMut(TransitionEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_transitionend( self, f: impl FnMut(TransitionEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_transitionrun( self, f: impl FnMut(TransitionEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_transitionstart( self, f: impl FnMut(TransitionEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_scroll(self, f: impl FnMut(Event, Self::DomElement) + 'static) -> Self

source§

fn on_scrollend(self, f: impl FnMut(Event, Self::DomElement) + 'static) -> Self

source§

fn on_securitypolicyviolation( self, f: impl FnMut(SecurityPolicyViolationEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_touchcancel( self, f: impl FnMut(TouchEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_touchend( self, f: impl FnMut(TouchEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_touchmove( self, f: impl FnMut(TouchEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_touchstart( self, f: impl FnMut(TouchEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_wheel(self, f: impl FnMut(WheelEvent, Self::DomElement) + 'static) -> Self

source§

fn on_copy(self, f: impl FnMut(Event, Self::DomElement) + 'static) -> Self

source§

fn on_cut(self, f: impl FnMut(Event, Self::DomElement) + 'static) -> Self

source§

fn on_paste(self, f: impl FnMut(Event, Self::DomElement) + 'static) -> Self

source§

impl<Dom: Dom> From<Img<Dom>> for GenericElement<Dom, Const>

source§

fn from(elem: Img<Dom, Mut>) -> Self

Converts to this type from the input type.
source§

impl<Dom: Dom, Mutability> From<Img<Dom, Mutability>> for GenericElement<Dom, Mutability>

source§

fn from(elem: Img<Dom, Mutability>) -> Self

Converts to this type from the input type.
source§

impl<Dom: Dom, Mutability> From<Img<Dom, Mutability>> for Node<Dom>

source§

fn from(elem: Img<Dom, Mutability>) -> Self

Converts to this type from the input type.
source§

impl<Dom: Dom> HtmlElement for Img<Dom>

source§

fn accesskey<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global accesskey Attribute Read more
source§

fn autocapitalize<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The Global autocapitalize Attribute Read more
source§

fn autofocus<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<bool>,

The Global autofocus Attribute Read more
source§

fn contenteditable<'a, T>( self, value: impl RefSignalOrValue<'a, Item = T> ) -> Self
where T: AsAttribute<String>,

The Global contenteditable Attribute Read more
source§

fn contextmenu<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global contextmenu Attribute Read more
source§

fn dir<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global dir Attribute Read more
source§

fn draggable<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global draggable Attribute Read more
source§

fn enterkeyhint<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global enterkeyhint Attribute Read more
source§

fn exportparts<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global exportparts Attribute Read more
source§

fn hidden<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<bool>,

The Global hidden Attribute Read more
source§

fn id<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global id Attribute Read more
source§

fn inputmode<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global inputmode Attribute Read more
source§

fn is<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global is Attribute Read more
source§

fn itemid<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global itemid Attribute Read more
source§

fn itemprop<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global itemprop Attribute Read more
source§

fn itemref<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global itemref Attribute Read more
source§

fn itemscope<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global itemscope Attribute Read more
source§

fn itemtype<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global itemtype Attribute Read more
source§

fn lang<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global lang Attribute Read more
source§

fn nonce<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global nonce Attribute Read more
source§

fn part<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global part Attribute Read more
source§

fn slot<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global slot Attribute Read more
source§

fn spellcheck<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global spellcheck Attribute Read more
source§

fn style<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global style Attribute Read more
source§

fn tabindex<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<i32>,

The Global tabindex Attribute Read more
source§

fn title<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global title Attribute Read more
source§

fn translate<'a, T>(self, value: impl RefSignalOrValue<'a, Item = T>) -> Self
where T: AsAttribute<String>,

The Global translate Attribute Read more
source§

impl<Dom: Dom> HtmlElementEvents for Img<Dom>

source§

fn on_beforeinput( self, f: impl FnMut(InputEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_change(self, f: impl FnMut(Event, Self::DomElement) + 'static) -> Self

source§

fn on_error(self, f: impl FnMut(Event, Self::DomElement) + 'static) -> Self

source§

fn on_input(self, f: impl FnMut(InputEvent, Self::DomElement) + 'static) -> Self

source§

fn on_drag(self, f: impl FnMut(DragEvent, Self::DomElement) + 'static) -> Self

source§

fn on_dragend( self, f: impl FnMut(DragEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_dragenter( self, f: impl FnMut(DragEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_dragleave( self, f: impl FnMut(DragEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_dragover( self, f: impl FnMut(DragEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_dragstart( self, f: impl FnMut(DragEvent, Self::DomElement) + 'static ) -> Self

source§

fn on_drop(self, f: impl FnMut(DragEvent, Self::DomElement) + 'static) -> Self

source§

fn on_load(self, f: impl FnMut(Event, Self::DomElement) + 'static) -> Self

source§

impl<Dom: Dom, Mutability> InDom for Img<Dom, Mutability>

§

type Dom = Dom

source§

impl<Dom: Dom, Mutability> Value for Img<Dom, Mutability>

Auto Trait Implementations§

§

impl<Dom, Mutability> Freeze for Img<Dom, Mutability>
where <Dom as Dom>::Element: Freeze,

§

impl<Dom = Dry, Mutability = Mut> !RefUnwindSafe for Img<Dom, Mutability>

§

impl<Dom = Dry, Mutability = Mut> !Send for Img<Dom, Mutability>

§

impl<Dom = Dry, Mutability = Mut> !Sync for Img<Dom, Mutability>

§

impl<Dom, Mutability> Unpin for Img<Dom, Mutability>
where <Dom as Dom>::Element: Unpin, Mutability: Unpin,

§

impl<Dom = Dry, Mutability = Mut> !UnwindSafe for Img<Dom, Mutability>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<'a, T> RefSignalOrValue<'a> for T
where T: RefValue<'a> + 'a,

§

type Item = T

The underlying type of the value or signal.
§

type Map<'b: 'a, F: FnMut(<T as RefSignalOrValue<'a>>::Item) -> R + 'b, R: RefSignalOrValue<'b, Item = R> + 'b> = R

The return type for Self::map. Read more
§

type Signal = Always<<T as RefSignalOrValue<'a>>::Item>

The signal type. Use Always for value types.
source§

fn map<'b, F, R>( self, callback: F ) -> <T as RefSignalOrValue<'a>>::Map<'b, F, R>
where 'b: 'a, R: RefSignalOrValue<'b, Item = R> + 'b, F: FnMut(<T as RefSignalOrValue<'a>>::Item) -> R + 'b,

Map a function over this signal/value to produce a new signal/value.
source§

fn select<FVal, FSig, Data, Out>( self, fn_val: FVal, _fn_sig: FSig, data: Data ) -> Out
where FVal: FnOnce(Data, <T as RefSignalOrValue<'a>>::Item) -> Out, FSig: FnOnce(Data, <T as RefSignalOrValue<'a>>::Signal) -> Out,

Select a function based on whether this is a signal or value. Read more
source§

fn select_spawn<FVal, FSig, Task, Exec>( self, fn_val: FVal, _fn_sig: FSig, executor: &mut Exec )
where FVal: FnOnce(&mut Exec, <T as RefSignalOrValue<'a>>::Item), FSig: FnOnce(&mut Exec, <T as RefSignalOrValue<'a>>::Signal) -> Task, Task: Future<Output = ()> + 'a, Exec: Executor,

Select a function based on whether this is a signal or value. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<D, T> ChildElement<D> for T
where D: Dom, T: Into<GenericElement<D, Const>> + Into<Node<D>> + Value + 'static,

source§

impl<D, T> ChildNode<D> for T
where D: Dom, T: Into<Node<D>> + Value + 'static,

source§

impl<T> RefValue<'static> for T
where T: Value,

source§

impl<T> SignalOrValue for T
where T: RefSignalOrValue<'static>,