Struct css_modules::stylesheet::Stylesheet
source · pub struct Stylesheet {
pub name: String,
pub children: Vec<Node>,
pub identifiers: HashMap<String, String>,
}
Fields§
§name: String
§children: Vec<Node>
§identifiers: HashMap<String, String>
Implementations§
source§impl<'t> Stylesheet
impl<'t> Stylesheet
pub fn new(name: &'t str, stylesheet: &'t str) -> ParserResult<'t, Self>
sourcepub fn id(&self, class: &str) -> Result<String, String>
pub fn id(&self, class: &str) -> Result<String, String>
Get the alias of a class or animation if it exists, otherwise return an error containing the identifier being searched for.
use css_modules::stylesheet::*;
let css = Stylesheet::new("my_module", ".myClass {}").unwrap();
assert_ne!("myClass", css.id("myClass").unwrap());
assert_eq!("notMyClass", css.id("notMyClass").unwrap_err());
Trait Implementations§
source§impl Debug for Stylesheet
impl Debug for Stylesheet
source§impl Display for Stylesheet
impl Display for Stylesheet
source§impl PartialEq for Stylesheet
impl PartialEq for Stylesheet
source§fn eq(&self, other: &Stylesheet) -> bool
fn eq(&self, other: &Stylesheet) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for Stylesheet
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