pub struct LayeredCss {
pub styles: BTreeMap<ScopeId, StyleTree>,
}
Fields§
§styles: BTreeMap<ScopeId, StyleTree>
We store each chains in a groups with root_scope_id as identifier of the group.
Implementations§
Source§impl LayeredCss
impl LayeredCss
pub fn new() -> Self
pub fn root_scope_exist(&self, root_scope_id: impl Into<ScopeId>) -> bool
pub fn layer_exist_in_root_scope( &self, root_scope_id: impl Into<ScopeId>, layer_scope_id: impl Into<ScopeId>, ) -> bool
Sourcepub fn add_style_from_parts(
&mut self,
root_scope_id: impl Into<ScopeId>,
order_in_chain: Order,
layer_scope_id: impl Into<ScopeId>,
style: impl Into<Style>,
) -> bool
pub fn add_style_from_parts( &mut self, root_scope_id: impl Into<ScopeId>, order_in_chain: Order, layer_scope_id: impl Into<ScopeId>, style: impl Into<Style>, ) -> bool
Add new style layer to root_scope_id. Returns false if layer already exists.
Sourcepub fn add_style_with_order<T>(
&mut self,
root_scope_id: ScopeId,
order_in_chain: Order,
) -> boolwhere
T: ScopeCommon,
pub fn add_style_with_order<T>(
&mut self,
root_scope_id: ScopeId,
order_in_chain: Order,
) -> boolwhere
T: ScopeCommon,
Add new style layer.
Uses ScopeCommon
implementation to retrieve layer_scope_id and style.
Returns false if layer already exists.
Sourcepub fn add_style_chain<C>(&mut self, ts_chain: &C) -> boolwhere
C: ScopeChainOps,
pub fn add_style_chain<C>(&mut self, ts_chain: &C) -> boolwhere
C: ScopeChainOps,
Add chain of styles to registry.
Uses information from ScopeChain
implementation,
to retrieve scope_id of each layer and its style.
Automatically detects root_scope_id and sets order based on distance from root.
Ignore empty styles.
Return true if any of the layers is new.
Trait Implementations§
Source§impl Clone for LayeredCss
impl Clone for LayeredCss
Source§fn clone(&self) -> LayeredCss
fn clone(&self) -> LayeredCss
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 moreSource§impl Debug for LayeredCss
impl Debug for LayeredCss
Source§impl Default for LayeredCss
impl Default for LayeredCss
Source§fn default() -> LayeredCss
fn default() -> LayeredCss
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LayeredCss
impl RefUnwindSafe for LayeredCss
impl Send for LayeredCss
impl Sync for LayeredCss
impl Unpin for LayeredCss
impl UnwindSafe for LayeredCss
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