Struct silkenweb::elements::SourceBuilder[][src]

pub struct SourceBuilder(_);

Implementations

impl SourceBuilder[src]

pub fn id(self, value: impl AttributeValue<String>) -> SourceBuilder[src]

pub fn class(self, value: impl AttributeValue<String>) -> SourceBuilder[src]

pub fn media(self, value: impl AttributeValue<String>) -> SourceBuilder[src]

Media query of the resource’s intended media; this should be used only in a <picture> element.

pub fn sizes(self, value: impl AttributeValue<String>) -> SourceBuilder[src]

Is a list of source sizes that describes the final rendered width of the image represented by the source. Each source size consists of a comma-separated list of media condition-length pairs. This information is used by the browser to determine, before laying the page out, which image defined in srcset to use. Please note that sizes will have its effect only if width dimension descriptors are provided with srcset instead of pixel ratio values (200w instead of 2x for example).

The sizes attribute has an effect only when the <source> element is the direct child of a <picture> element.

pub fn src(self, value: impl AttributeValue<String>) -> SourceBuilder[src]

Required for <audio> and <video>, address of the media resource. The value of this attribute is ignored when the <source> element is placed inside a <picture> element.

pub fn srcset(self, value: impl AttributeValue<String>) -> SourceBuilder[src]

A list of one or more strings separated by commas indicating a set of possible images represented by the source for the browser to use. Each string is composed of:

  1. One URL specifying an image.
  2. A width descriptor, which consists of a string containing a positive integer directly followed by “w”, such as 300w. The default value, if missing, is the infinity.
  3. A pixel density descriptor, that is a positive floating number directly followed by “x”. The default value, if missing, is 1x.

Each string in the list must have at least a width descriptor or a pixel density descriptor to be valid. Among the list, there must be only one string containing the same tuple of width descriptor and pixel density descriptor. The browser chooses the most adequate image to display at a given point of time.

The srcset attribute has an effect only when the <source> element is the direct child of a <picture> element.

pub fn type_(self, value: impl AttributeValue<String>) -> SourceBuilder[src]

The MIME media type of the resource, optionally with a codecs parameter.

impl SourceBuilder[src]

pub fn on_blur(
    self,
    f: impl FnMut(FocusEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
[src]

pub fn on_click(
    self,
    f: impl FnMut(MouseEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
[src]

pub fn on_change(
    self,
    f: impl FnMut(Event, HtmlSourceElement) + 'static
) -> SourceBuilder
[src]

pub fn on_dblclick(
    self,
    f: impl FnMut(MouseEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
[src]

pub fn on_focusout(
    self,
    f: impl FnMut(FocusEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
[src]

pub fn on_input(
    self,
    f: impl FnMut(InputEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
[src]

pub fn on_keydown(
    self,
    f: impl FnMut(KeyboardEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
[src]

pub fn on_keyup(
    self,
    f: impl FnMut(KeyboardEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
[src]

pub fn effect(self, f: impl Effect<HtmlSourceElement>) -> SourceBuilder[src]

Trait Implementations

impl Builder for SourceBuilder[src]

type Target = Source

impl DomElement for SourceBuilder[src]

impl From<SourceBuilder> for Element[src]

impl From<SourceBuilder> for ElementBuilder[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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.