pub struct Signature {
pub parameters: Vec<Box<dyn DataType>>,
pub return_type: Box<dyn DataType>,
}
Expand description
Signature struct is a representation of function type
Function type in GitQL used to track parameters and return type for now but later can track parameter names to allow pass parameter by name and improve error messages
GitQL Function Signature has some rules to follow
Rules:
- Parameters must contains 0 or 1 [
DataType::Varargs
] parameter type only. - [
DataType::Varargs
] must be the last parameter. - You can add 0 or more [
DataType::Optional
] parameters. - [
DataType::Optional
] parameters must be at the end but also before [DataType::Varargs
] if exists.
The return type can be a static DataType
such as Int, Flow or Dynamic
so you can return a dynamic type depending on parameters.
Fields§
§parameters: Vec<Box<dyn DataType>>
§return_type: Box<dyn DataType>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Signature
impl !RefUnwindSafe for Signature
impl !Send for Signature
impl !Sync for Signature
impl Unpin for Signature
impl !UnwindSafe for Signature
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)