pub struct Def<S, F = Term<S>> {
pub name: S,
pub args: Vec<S>,
pub body: F,
}Expand description
jq definition, consisting of a name, optional arguments, and a body.
Examples:
def pi: 3.1415;
def double($x): $x + $x;
def map(f): [.[] | f];
def recurse(f; cond): recurse(f | select(cond));Fields§
§name: Sname, e.g. "double" or "map"
args: Vec<S>arguments, e.g. ["$x"], ["f"], or ["f", "cond"]
body: Fright-hand side, e.g. a term corresponding to [.[] | f]
Trait Implementations§
Auto Trait Implementations§
impl<S, F> Freeze for Def<S, F>
impl<S, F> RefUnwindSafe for Def<S, F>where
S: RefUnwindSafe,
F: RefUnwindSafe,
impl<S, F> Send for Def<S, F>
impl<S, F> Sync for Def<S, F>
impl<S, F> Unpin for Def<S, F>
impl<S, F> UnwindSafe for Def<S, F>where
S: UnwindSafe,
F: UnwindSafe,
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