pub struct Arg { /* private fields */ }Expand description
Argument of a definition, such as $v or f in def foo($v; f): ....
Implementations§
source§impl Arg
impl Arg
sourcepub fn new_var(name: String) -> Self
pub fn new_var(name: String) -> Self
Create a variable argument with given name (without leading “$”).
sourcepub fn new_filter(name: String) -> Self
pub fn new_filter(name: String) -> Self
Create a filter argument with given name.
sourcepub fn get_var(&self) -> Option<&str>
pub fn get_var(&self) -> Option<&str>
If the argument is a variable, return its name without leading “$”, otherwise None.
sourcepub fn get_filter(&self) -> Option<&str>
pub fn get_filter(&self) -> Option<&str>
If the argument is a filter, return its name, otherwise None.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Arg
impl<'de> Deserialize<'de> for Arg
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Arg
impl Send for Arg
impl Sync for Arg
impl Unpin for Arg
impl UnwindSafe for Arg
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