pub struct Name { /* private fields */ }
Expand description
A sass name, used to idenify functions, variables, mixins, etc.
A -
and a _
is considered equal in a name, both represented by a _
.
Examples
assert_eq!(Name::from("foo-bar"), Name::from("foo_bar"));
assert_eq!(Name::from_static("foo_bar"), Name::from("foo-bar"));
Implementations§
source§impl Name
impl Name
sourcepub fn from_static(key: &'static str) -> Name
pub fn from_static(key: &'static str) -> Name
Key must not contain -
.
This function panics in debug mode if the key contains -
.
sourcepub fn split_module(&self) -> Option<(String, Name)>
pub fn split_module(&self) -> Option<(String, Name)>
Check if a name is “module.local”.
If so, return the module name and the local name as separate names.
Trait Implementations§
source§impl Ord for Name
impl Ord for Name
source§impl PartialEq for Name
impl PartialEq for Name
source§impl PartialOrd for Name
impl PartialOrd for Name
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Name
impl StructuralEq for Name
impl StructuralPartialEq for Name
Auto Trait Implementations§
impl RefUnwindSafe for Name
impl Send for Name
impl Sync for Name
impl Unpin for Name
impl UnwindSafe for Name
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