pub struct Function {
pub name: String,
pub parameters: Vec<Parameter>,
pub return_type: String,
pub body: Option<String>,
pub description: Option<String>,
}Expand description
User-defined function definition
Fields§
§name: StringFunction name
parameters: Vec<Parameter>Parameter definitions
return_type: StringReturn type
body: Option<String>Optional function body (KQL expression)
description: Option<String>Optional description
Implementations§
Source§impl Function
impl Function
Sourcepub fn new(name: impl Into<String>, return_type: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, return_type: impl Into<String>) -> Self
Create a new function
Sourcepub fn add_parameter(&mut self, param: Parameter) -> &mut Self
pub fn add_parameter(&mut self, param: Parameter) -> &mut Self
Add a parameter
Sourcepub fn param(
self,
name: impl Into<String>,
data_type: impl Into<String>,
) -> Self
pub fn param( self, name: impl Into<String>, data_type: impl Into<String>, ) -> Self
Builder method to add a parameter
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
Set the description
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Function
impl<'de> Deserialize<'de> for Function
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 Freeze for Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnwindSafe for Function
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)