StyleResourceExt

Trait StyleResourceExt 

Source
pub trait StyleResourceExt {
    // Required methods
    fn set(
        &self,
        name: impl Into<ImmutableString>,
        property: impl Into<StyleProperty>,
    );
    fn get<P>(&self, name: impl Into<ImmutableString>) -> Option<P>
       where StyleProperty: IntoPrimitive<P>;
    fn get_or<P>(&self, name: impl Into<ImmutableString>, default: P) -> P
       where StyleProperty: IntoPrimitive<P>;
    fn get_or_default<P>(&self, name: impl Into<ImmutableString>) -> P
       where P: Default,
             StyleProperty: IntoPrimitive<P>;
    fn property<P>(&self, name: impl Into<ImmutableString>) -> StyledProperty<P>
       where P: Default,
             StyleProperty: IntoPrimitive<P>;
}
Expand description

Extension methods for StyleResource.

Required Methods§

Source

fn set( &self, name: impl Into<ImmutableString>, property: impl Into<StyleProperty>, )

Same as Style::set.

Source

fn get<P>(&self, name: impl Into<ImmutableString>) -> Option<P>

Same as Style::get.

Source

fn get_or<P>(&self, name: impl Into<ImmutableString>, default: P) -> P

Same as Style::get_or.

Source

fn get_or_default<P>(&self, name: impl Into<ImmutableString>) -> P

Source

fn property<P>(&self, name: impl Into<ImmutableString>) -> StyledProperty<P>

Same as Style::property.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§