Struct ori_core::StyleLoader
source · pub struct StyleLoader { /* private fields */ }
Expand description
A style loader that can load styles from files and inline styles.
Styles that are loaded from files are reloaded when the file is modified.
Implementations§
source§impl StyleLoader
impl StyleLoader
pub fn clear(&mut self)
sourcepub fn add_style<T: TryInto<LoadedStyleKind>>(
&mut self,
style: T
) -> Result<(), T::Error>
pub fn add_style<T: TryInto<LoadedStyleKind>>( &mut self, style: T ) -> Result<(), T::Error>
Adds a style to the loader.
sourcepub fn reload(&mut self) -> Result<bool, StyleLoadError>
pub fn reload(&mut self) -> Result<bool, StyleLoadError>
Reloads the styles if the files have been modified.
sourcepub fn style(&self) -> &Stylesheet
pub fn style(&self) -> &Stylesheet
Returns the style.
Trait Implementations§
source§impl Clone for StyleLoader
impl Clone for StyleLoader
source§fn clone(&self) -> StyleLoader
fn clone(&self) -> StyleLoader
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for StyleLoader
impl !Send for StyleLoader
impl !Sync for StyleLoader
impl Unpin for StyleLoader
impl !UnwindSafe for StyleLoader
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> Styleable<T> for T
impl<T> Styleable<T> for T
source§fn styled(self) -> Styled<T>
fn styled(self) -> Styled<T>
Converts the
self
into a Styled<Self>
value.source§fn attr_trans(
self,
key: &str,
value: impl Into<StyleAttributeValue>,
transition: impl Into<StyleTransition>
) -> Styled<T>
fn attr_trans( self, key: &str, value: impl Into<StyleAttributeValue>, transition: impl Into<StyleTransition> ) -> Styled<T>
Adds an attribute with a transition.