use std::borrow::Cow;
use super::{DataType, Deprecated};
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct Function {
pub asyncness: bool,
pub name: Cow<'static, str>,
pub args: Vec<(Cow<'static, str>, DataType)>,
pub result: Option<DataType>,
pub docs: Cow<'static, str>,
pub deprecated: Option<Deprecated>,
}
impl Function {
pub fn asyncness(&self) -> bool {
self.asyncness
}
pub fn name(&self) -> &str {
&self.name
}
pub fn args(&self) -> &[(Cow<'static, str>, DataType)] {
&self.args
}
pub fn result(&self) -> Option<&DataType> {
self.result.as_ref()
}
}