Struct rsass::sass::SassString
source · pub struct SassString { /* private fields */ }
Expand description
A string that may contain interpolations.
Used in all places in sass items and values where interpolations may occur.
Implementations§
source§impl SassString
impl SassString
sourcepub fn new(parts: Vec<StringPart>, quotes: Quotes) -> Self
pub fn new(parts: Vec<StringPart>, quotes: Quotes) -> Self
Create a new sassstring from parts.
sourcepub fn evaluate(&self, scope: ScopeRef) -> Result<CssString, Error>
pub fn evaluate(&self, scope: ScopeRef) -> Result<CssString, Error>
Evaluate this SassString
to a CssString
.
All interpolated values are interpolated in the given scope
.
sourcepub fn is_unquoted(&self) -> bool
pub fn is_unquoted(&self) -> bool
Return true if self represents an unquoted string.
sourcepub fn is_interpolated(&self) -> bool
pub fn is_interpolated(&self) -> bool
Return true if self contains any string interpolation(s).
sourcepub fn single_raw(&self) -> Option<&str>
pub fn single_raw(&self) -> Option<&str>
Check if this SassString
is a single raw value.
If so, return a reference to it.
Trait Implementations§
source§impl Clone for SassString
impl Clone for SassString
source§fn clone(&self) -> SassString
fn clone(&self) -> SassString
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 SassString
impl Debug for SassString
source§impl Display for SassString
impl Display for SassString
source§impl From<&str> for SassString
impl From<&str> for SassString
source§impl From<CssString> for SassString
impl From<CssString> for SassString
source§impl From<String> for SassString
impl From<String> for SassString
source§impl PartialEq for SassString
impl PartialEq for SassString
source§fn eq(&self, other: &SassString) -> bool
fn eq(&self, other: &SassString) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for SassString
impl PartialOrd for SassString
source§fn partial_cmp(&self, other: &SassString) -> Option<Ordering>
fn partial_cmp(&self, other: &SassString) -> Option<Ordering>
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 SassString
impl StructuralPartialEq for SassString
Auto Trait Implementations§
impl Freeze for SassString
impl RefUnwindSafe for SassString
impl Send for SassString
impl Sync for SassString
impl Unpin for SassString
impl UnwindSafe for SassString
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