pub struct StyleSheet { /* private fields */ }Expand description
Implementations§
Source§impl StyleSheet
 
impl StyleSheet
pub const fn new_const() -> Self
Sourcepub fn get_styles(
    &mut self,
    selector: impl AsRef<str>,
) -> SmallVec<[(Option<PseudoClass>, SmallVec<[Declaration; 32]>); 4]>
 
pub fn get_styles( &mut self, selector: impl AsRef<str>, ) -> SmallVec<[(Option<PseudoClass>, SmallVec<[Declaration; 32]>); 4]>
Retrieves the styles for a given selector.
§Parameters
- selector: A CSS selector (e.g.,- .class,- #id).
§Returns
- Some(SmallVec<Declaration>)if styles exist for the selector.
- Noneif no matching styles are found.
§Example
let css = ".example { color: red; }";
let mut stylesheet = cssengine::StyleSheet::from_css(css);
if let Some(styles) = stylesheet.get_styles(".example") {
    println!("Styles: {:?}", styles);
}Auto Trait Implementations§
impl Freeze for StyleSheet
impl RefUnwindSafe for StyleSheet
impl Send for StyleSheet
impl Sync for StyleSheet
impl Unpin for StyleSheet
impl UnwindSafe for StyleSheet
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