Skip to main content

Style

Struct Style 

Source
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,

Source§

const MIN_LENGTH: usize = 0

The minimum length of this attribute in HTML.
Source§

type AsyncOutput = Style<<S as IntoStyle>::AsyncOutput>

The type once all async data have loaded.
Source§

type State = <S as IntoStyle>::State

The state that should be retained between building and rebuilding.
Source§

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>

An equivalent to this attribute that can be cloned to be shared across elements, and captures no references shorter than 'static.
Source§

fn html_len(&self) -> usize

An approximation of the actual length of this attribute in HTML.
Source§

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

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

Adds this attribute to the element during client-side rendering.
Source§

fn rebuild(self, state: &mut Self::State)

Applies a new value for the attribute.
Source§

fn into_cloneable(self) -> Self::Cloneable

Converts this attribute into an equivalent that can be cloned.
Source§

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)

“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

“Resolves” this into a type that is not waiting for any asynchronous data.
Source§

fn keys(&self) -> Vec<NamedAttributeKey>

Returns a set of attribute keys, associated with this attribute, if any. Read more
Source§

impl<S> Clone for Style<S>
where S: Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S: Debug> Debug for Style<S>

Source§

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

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

impl<S> NextAttribute for Style<S>
where S: IntoStyle,

Source§

type Output<NewAttr: Attribute> = (Style<S>, NewAttr)

The type of the new, combined attribute.
Source§

fn add_any_attr<NewAttr: Attribute>( self, new_attr: NewAttr, ) -> Self::Output<NewAttr>

Adds a new attribute.
Source§

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, )

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.
Source§

const TEMPLATE: &'static str = ""

The HTML content of the static template.
Source§

const CLASS: &'static str = ""

The class attribute content known at compile time.
Source§

const STYLE: &'static str = ""

The style attribute content known at compile time.
Source§

const LEN: usize = _

The length of the template.
Source§

fn to_template_attribute( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )

Renders a view type to a template in attribute position.

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoAnyAttribute for T
where T: Send + Attribute, Element: Clone,

Source§

fn into_any_attr(self) -> AnyAttribute

Wraps the given attribute.
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> SerializableKey for T

Source§

fn ser_key(&self) -> String

Serializes the key to a unique string. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.