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§
Sourcefn set(
&self,
name: impl Into<ImmutableString>,
property: impl Into<StyleProperty>,
)
fn set( &self, name: impl Into<ImmutableString>, property: impl Into<StyleProperty>, )
Same as Style::set.
Sourcefn get<P>(&self, name: impl Into<ImmutableString>) -> Option<P>where
StyleProperty: IntoPrimitive<P>,
fn get<P>(&self, name: impl Into<ImmutableString>) -> Option<P>where
StyleProperty: IntoPrimitive<P>,
Same as Style::get.
Sourcefn get_or<P>(&self, name: impl Into<ImmutableString>, default: P) -> Pwhere
StyleProperty: IntoPrimitive<P>,
fn get_or<P>(&self, name: impl Into<ImmutableString>, default: P) -> Pwhere
StyleProperty: IntoPrimitive<P>,
Same as Style::get_or.
Sourcefn get_or_default<P>(&self, name: impl Into<ImmutableString>) -> P
fn get_or_default<P>(&self, name: impl Into<ImmutableString>) -> P
Same as Style::get_or_default.
Sourcefn property<P>(&self, name: impl Into<ImmutableString>) -> StyledProperty<P>
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.