pub struct Style<S> { /* private fields */ }Expand description
An Attribute that will add to an element’s CSS styles.
Trait Implementations§
Source§impl<S> Attribute for Style<S>where
S: IntoStyle,
impl<S> Attribute for Style<S>where
S: IntoStyle,
Source§const MIN_LENGTH: usize = 0
const MIN_LENGTH: usize = 0
The minimum length of this attribute in HTML.
Source§type AsyncOutput = Style<<S as IntoStyle>::AsyncOutput>
type AsyncOutput = Style<<S as IntoStyle>::AsyncOutput>
The type once all async data have loaded.
Source§type State = <S as IntoStyle>::State
type State = <S as IntoStyle>::State
The state that should be retained between building and rebuilding.
Source§type Cloneable = Style<<S as IntoStyle>::Cloneable>
type Cloneable = Style<<S as IntoStyle>::Cloneable>
An equivalent to this attribute that can be cloned to be shared across elements.
Source§type CloneableOwned = Style<<S as IntoStyle>::CloneableOwned>
type CloneableOwned = Style<<S as IntoStyle>::CloneableOwned>
An equivalent to this attribute that can be cloned to be shared across elements, and
captures no references shorter than
'static.Source§fn to_html(
self,
_buf: &mut String,
_style: &mut String,
style: &mut String,
_inner_html: &mut String,
)
fn to_html( self, _buf: &mut String, _style: &mut String, style: &mut String, _inner_html: &mut String, )
Renders the attribute to HTML. Read more
Source§fn hydrate<const FROM_SERVER: bool>(self, el: &Element) -> Self::State
fn hydrate<const FROM_SERVER: bool>(self, el: &Element) -> Self::State
Adds interactivity as necessary, given DOM nodes that were created from HTML that has
either been rendered on the server, or cloned for a
<template>.Source§fn build(self, el: &Element) -> Self::State
fn build(self, el: &Element) -> Self::State
Adds this attribute to the element during client-side rendering.
Source§fn into_cloneable(self) -> Self::Cloneable
fn into_cloneable(self) -> Self::Cloneable
Converts this attribute into an equivalent that can be cloned.
Source§fn into_cloneable_owned(self) -> Self::CloneableOwned
fn into_cloneable_owned(self) -> Self::CloneableOwned
Converts this attributes into an equivalent that can be cloned and is
'static.Source§fn dry_resolve(&mut self)
fn dry_resolve(&mut self)
“Runs” the attribute without other side effects. For primitive types, this is a no-op. For
reactive types, this can be used to gather data about reactivity or about asynchronous data
that needs to be loaded.
Source§async fn resolve(self) -> Self::AsyncOutput
async fn resolve(self) -> Self::AsyncOutput
“Resolves” this into a type that is not waiting for any asynchronous data.
Source§impl<S> NextAttribute for Style<S>where
S: IntoStyle,
impl<S> NextAttribute for Style<S>where
S: IntoStyle,
Source§impl<S> ToTemplate for Style<S>where
S: IntoStyle,
impl<S> ToTemplate for Style<S>where
S: IntoStyle,
Source§fn to_template(
_buf: &mut String,
_style: &mut String,
_class: &mut String,
_inner_html: &mut String,
_position: &mut Position,
)
fn to_template( _buf: &mut String, _style: &mut String, _class: &mut String, _inner_html: &mut String, _position: &mut Position, )
Renders a view type to a template. This does not take actual view data,
but can be used for constructing part of an HTML
<template> that corresponds
to a view of a particular type.Auto Trait Implementations§
impl<S> Freeze for Style<S>where
S: Freeze,
impl<S> RefUnwindSafe for Style<S>where
S: RefUnwindSafe,
impl<S> Send for Style<S>where
S: Send,
impl<S> Sync for Style<S>where
S: Sync,
impl<S> Unpin for Style<S>where
S: Unpin,
impl<S> UnsafeUnpin for Style<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for Style<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoAnyAttribute for T
impl<T> IntoAnyAttribute for T
Source§fn into_any_attr(self) -> AnyAttribute
fn into_any_attr(self) -> AnyAttribute
Wraps the given attribute.
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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