pub struct ArgumentResult { /* private fields */ }Expand description
Function arguments that have been evaluated
Arguments may be passed either positionally or by name. Positional arguments may not come after named ones.
Implementations§
Source§impl ArgumentResult
impl ArgumentResult
Sourcepub fn get_named<T: Into<Identifier>>(
&mut self,
val: T,
) -> Option<Spanned<Value>>
pub fn get_named<T: Into<Identifier>>( &mut self, val: T, ) -> Option<Spanned<Value>>
Get argument by name
Removes the argument
Sourcepub fn get_positional(&mut self, idx: usize) -> Option<Spanned<Value>>
pub fn get_positional(&mut self, idx: usize) -> Option<Spanned<Value>>
Get a positional argument by 0-indexed position
Replaces argument with Value::Null gravestone
Sourcepub fn get<T: Into<Identifier>>(
&mut self,
position: usize,
name: T,
) -> Option<Spanned<Value>>
pub fn get<T: Into<Identifier>>( &mut self, position: usize, name: T, ) -> Option<Spanned<Value>>
Get an argument by either name or position
If the named argument does not exist, then the position is checked. Like
ArgumentResult::get_named and ArgumentResult::get_positional, this
function removes the argument or replaces it with a gravestone
Sourcepub fn get_err(&mut self, position: usize, name: &str) -> SassResult<Value>
pub fn get_err(&mut self, position: usize, name: &str) -> SassResult<Value>
Like ArgumentResult::get, but returns a result if the argument doesn’t exist
pub const fn span(&self) -> Span
Sourcepub fn max_args(&self, max: usize) -> SassResult<()>
pub fn max_args(&self, max: usize) -> SassResult<()>
Assert that this function has at most max number of args
Trait Implementations§
Source§impl Clone for ArgumentResult
impl Clone for ArgumentResult
Source§fn clone(&self) -> ArgumentResult
fn clone(&self) -> ArgumentResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ArgumentResult
impl !Send for ArgumentResult
impl !Sync for ArgumentResult
impl !UnwindSafe for ArgumentResult
impl Freeze for ArgumentResult
impl Unpin for ArgumentResult
impl UnsafeUnpin for ArgumentResult
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