Struct silkenweb::elements::SourceBuilder [−][src]
pub struct SourceBuilder(_);
Implementations
impl SourceBuilder
[src]
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:
- One URL specifying an image.
- 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.
- 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]
impl SourceBuilder
[src]pub fn on_blur(
self,
f: impl FnMut(FocusEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
[src]
self,
f: impl FnMut(FocusEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
pub fn on_click(
self,
f: impl FnMut(MouseEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
[src]
self,
f: impl FnMut(MouseEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
pub fn on_change(
self,
f: impl FnMut(Event, HtmlSourceElement) + 'static
) -> SourceBuilder
[src]
self,
f: impl FnMut(Event, HtmlSourceElement) + 'static
) -> SourceBuilder
pub fn on_dblclick(
self,
f: impl FnMut(MouseEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
[src]
self,
f: impl FnMut(MouseEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
pub fn on_focusout(
self,
f: impl FnMut(FocusEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
[src]
self,
f: impl FnMut(FocusEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
pub fn on_input(
self,
f: impl FnMut(InputEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
[src]
self,
f: impl FnMut(InputEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
pub fn on_keydown(
self,
f: impl FnMut(KeyboardEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
[src]
self,
f: impl FnMut(KeyboardEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
pub fn on_keyup(
self,
f: impl FnMut(KeyboardEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
[src]
self,
f: impl FnMut(KeyboardEvent, HtmlSourceElement) + 'static
) -> SourceBuilder
pub fn effect(self, f: impl Effect<HtmlSourceElement>) -> SourceBuilder
[src]
Trait Implementations
impl Builder for SourceBuilder
[src]
impl Builder for SourceBuilder
[src]type Target = Source
pub fn build(self) -> <SourceBuilder as Builder>::Target
[src]
pub fn into_element(self) -> Element
[src]
impl DomElement for SourceBuilder
[src]
impl DomElement for SourceBuilder
[src]type Target = HtmlSourceElement
pub fn dom_element(&self) -> <SourceBuilder as DomElement>::Target
[src]
impl From<SourceBuilder> for Element
[src]
impl From<SourceBuilder> for Element
[src]pub fn from(builder: SourceBuilder) -> Element
[src]
impl From<SourceBuilder> for ElementBuilder
[src]
impl From<SourceBuilder> for ElementBuilder
[src]pub fn from(builder: SourceBuilder) -> ElementBuilder
[src]
Auto Trait Implementations
impl !RefUnwindSafe for SourceBuilder
impl !RefUnwindSafe for SourceBuilder
impl !Send for SourceBuilder
impl !Send for SourceBuilder
impl !Sync for SourceBuilder
impl !Sync for SourceBuilder
impl Unpin for SourceBuilder
impl Unpin for SourceBuilder
impl !UnwindSafe for SourceBuilder
impl !UnwindSafe for SourceBuilder