Struct savory_style::style::StyleValues[][src]

pub struct StyleValues(pub IndexMap<St, String>);

Implementations

impl StyleValues[src]

pub fn get(&self, key: &St) -> Option<&str>[src]

pub fn add(self, key: impl Into<St>, value: impl ToString) -> Self[src]

This method provied a way to add custom style or css style that doesn’t have it’s own method yet.

use savory_style::{StyleValues, UpdateStyleValues, values as val, St};

let mut map = StyleValues::default();
map.add(St::UserSelect, val::None)
    .add(St::BoxSizing, val::BorderBox);

pub fn try_add(self, key: impl Into<St>, value: Option<impl ToString>) -> Self[src]

This method is similar add but it accept an optional value, if the passed value is None then nothing added to the style.

pub fn add_custom(
    self,
    key: impl Into<Cow<'static, str>>,
    value: impl ToString
) -> Self
[src]

pub fn try_add_custom(
    self,
    key: impl Into<Cow<'static, str>>,
    value: Option<impl ToString>
) -> Self
[src]

pub fn merge(self, other: impl UpdateStyleValues) -> Self[src]

Merge this style map with other

pub fn try_merge(self, other: Option<impl UpdateStyleValues>) -> Self[src]

This method is similar to merge but it accept an optional value.

Trait Implementations

impl Clone for StyleValues[src]

impl Debug for StyleValues[src]

impl Default for StyleValues[src]

impl<__IdxT> Index<__IdxT> for StyleValues where
    IndexMap<St, String>: Index<__IdxT>, 
[src]

type Output = <IndexMap<St, String> as Index<__IdxT>>::Output

The returned type after indexing.

impl<__IdxT> IndexMut<__IdxT> for StyleValues where
    IndexMap<St, String>: IndexMut<__IdxT>, 
[src]

impl IntoIterator for StyleValues[src]

type Item = <IndexMap<St, String> as IntoIterator>::Item

The type of the elements being iterated over.

type IntoIter = <IndexMap<St, String> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?

impl PartialEq<StyleValues> for StyleValues[src]

impl StructuralPartialEq for StyleValues[src]

Auto Trait Implementations

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    T: Component + Float,
    D: AdaptFrom<S, Swp, Dwp, T>,
    Swp: WhitePoint,
    Dwp: WhitePoint
[src]

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, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,