pub struct StyleEngine { /* private fields */ }
Expand description
Style engine for efficient style computation and caching
Implementations§
Source§impl StyleEngine
impl StyleEngine
Sourcepub fn add_global_rules(&mut self, rules: Vec<StyleRule>)
pub fn add_global_rules(&mut self, rules: Vec<StyleRule>)
Add global CSS rules that apply to all components
Sourcepub fn add_component_rules(
&mut self,
component_id: ComponentId,
rules: Vec<StyleRule>,
)
pub fn add_component_rules( &mut self, component_id: ComponentId, rules: Vec<StyleRule>, )
Add component-scoped CSS rules
Sourcepub fn compute_style(
&mut self,
component_id: ComponentId,
base_style: &Style,
context: &StyleContext,
) -> Result<ComputedStyle, StyleError>
pub fn compute_style( &mut self, component_id: ComponentId, base_style: &Style, context: &StyleContext, ) -> Result<ComputedStyle, StyleError>
Compute the final style for a component with context
Sourcepub fn get_stats(&self) -> StyleStats
pub fn get_stats(&self) -> StyleStats
Get performance statistics
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear style cache (useful for memory management)
Sourcepub fn set_inheritance(&mut self, child_id: ComponentId, parent_id: ComponentId)
pub fn set_inheritance(&mut self, child_id: ComponentId, parent_id: ComponentId)
Set parent-child inheritance relationship
Trait Implementations§
Source§impl Debug for StyleEngine
impl Debug for StyleEngine
Auto Trait Implementations§
impl !Freeze for StyleEngine
impl RefUnwindSafe for StyleEngine
impl Send for StyleEngine
impl Sync for StyleEngine
impl Unpin for StyleEngine
impl UnwindSafe for StyleEngine
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