pub struct FunctionDefBuilder { /* private fields */ }Expand description
Builder for FunctionDef.
Implementations§
Source§impl FunctionDefBuilder
impl FunctionDefBuilder
Sourcepub fn new(name: &'static str) -> Self
pub fn new(name: &'static str) -> Self
Start building a function with the given canonical name.
Sourcepub fn kind(self, kind: FunctionKind) -> Self
pub fn kind(self, kind: FunctionKind) -> Self
Set the function category.
Sourcepub fn max_args(self, max: Option<usize>) -> Self
pub fn max_args(self, max: Option<usize>) -> Self
Set the maximum number of arguments (None = unlimited).
Sourcepub fn param_types(self, types: &[Option<DataType>]) -> Self
pub fn param_types(self, types: &[Option<DataType>]) -> Self
Set expected parameter types for type-checking.
Sourcepub fn return_type(self, ty: DataType) -> Self
pub fn return_type(self, ty: DataType) -> Self
Set the return type for type inference.
Sourcepub fn supports_distinct(self, yes: bool) -> Self
pub fn supports_distinct(self, yes: bool) -> Self
Whether DISTINCT is allowed (e.g. COUNT(DISTINCT col)).
Sourcepub fn supports_order_by(self, yes: bool) -> Self
pub fn supports_order_by(self, yes: bool) -> Self
Whether an ORDER BY child clause is allowed.
Sourcepub fn allows_star(self, yes: bool) -> Self
pub fn allows_star(self, yes: bool) -> Self
Whether * is accepted as an argument (e.g. COUNT(*)).
Sourcepub fn dialects(self, dialects: &[Dialect]) -> Self
pub fn dialects(self, dialects: &[Dialect]) -> Self
Restrict this function to specific SQL dialects.
Sourcepub fn build(self) -> FunctionDef
pub fn build(self) -> FunctionDef
Finalise the builder and produce a FunctionDef.
Trait Implementations§
Source§impl Clone for FunctionDefBuilder
impl Clone for FunctionDefBuilder
Source§fn clone(&self) -> FunctionDefBuilder
fn clone(&self) -> FunctionDefBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FunctionDefBuilder
impl RefUnwindSafe for FunctionDefBuilder
impl Send for FunctionDefBuilder
impl Sync for FunctionDefBuilder
impl Unpin for FunctionDefBuilder
impl UnsafeUnpin for FunctionDefBuilder
impl UnwindSafe for FunctionDefBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request