pub struct JsonnetFunction {
pub parameters: Vec<String>,
pub body: Box<Expr>,
pub environment: HashMap<String, JsonnetValue>,
}Expand description
Jsonnet function representation
Fields§
§parameters: Vec<String>§body: Box<Expr>§environment: HashMap<String, JsonnetValue>Implementations§
Source§impl JsonnetFunction
impl JsonnetFunction
Sourcepub fn new(
parameters: Vec<String>,
body: Box<Expr>,
environment: HashMap<String, JsonnetValue>,
) -> Self
pub fn new( parameters: Vec<String>, body: Box<Expr>, environment: HashMap<String, JsonnetValue>, ) -> Self
Create a new function
Sourcepub fn call(&self, args: Vec<JsonnetValue>) -> Result<JsonnetValue>
pub fn call(&self, args: Vec<JsonnetValue>) -> Result<JsonnetValue>
Call the function with arguments
Trait Implementations§
Source§impl Clone for JsonnetFunction
impl Clone for JsonnetFunction
Source§fn clone(&self) -> JsonnetFunction
fn clone(&self) -> JsonnetFunction
Returns a duplicate 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 JsonnetFunction
impl Debug for JsonnetFunction
Source§impl PartialEq for JsonnetFunction
impl PartialEq for JsonnetFunction
Auto Trait Implementations§
impl Freeze for JsonnetFunction
impl RefUnwindSafe for JsonnetFunction
impl Send for JsonnetFunction
impl Sync for JsonnetFunction
impl Unpin for JsonnetFunction
impl UnwindSafe for JsonnetFunction
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