Struct FunctionOverload

Source
pub struct FunctionOverload<F, A, R, C>(/* private fields */);
Expand description

An overload of a function in GeoScript.

Trait Implementations§

Source§

impl<F: Debug, A: Debug, R: Debug, C: Debug> Debug for FunctionOverload<F, A, R, C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<R, F> Overload for FunctionOverload<F, (), R, &CompileContext>
where R: GeoType + Into<AnyExpr> + 'static, F: Fn(&CompileContext, Properties) -> R,

Source§

fn get_returned_type(&self, params: &[AnyExpr]) -> Option<Type>

Get the return type for the given parameters. Returns None if the overload cannot be called with these parameters.
Source§

fn unroll( &self, params: Vec<AnyExpr>, context: &mut CompileContext, props: Properties, ) -> AnyExpr

Unroll the function for the given params. The resulting expression matches the type returned by get_returned_type.
Source§

impl<R, F> Overload for FunctionOverload<F, (), R, &mut CompileContext>
where R: GeoType + Into<AnyExpr> + 'static, F: Fn(&mut CompileContext, Properties) -> R,

Source§

fn get_returned_type(&self, params: &[AnyExpr]) -> Option<Type>

Get the return type for the given parameters. Returns None if the overload cannot be called with these parameters.
Source§

fn unroll( &self, params: Vec<AnyExpr>, context: &mut CompileContext, props: Properties, ) -> AnyExpr

Unroll the function for the given params. The resulting expression matches the type returned by get_returned_type.
Source§

impl<T0, R, F> Overload for FunctionOverload<F, (T0,), R, &CompileContext>
where T0: GeoType + 'static, R: GeoType + Into<AnyExpr> + 'static, F: Fn(T0, &CompileContext, Properties) -> R,

Source§

fn get_returned_type(&self, params: &[AnyExpr]) -> Option<Type>

Get the return type for the given parameters. Returns None if the overload cannot be called with these parameters.
Source§

fn unroll( &self, params: Vec<AnyExpr>, context: &mut CompileContext, props: Properties, ) -> AnyExpr

Unroll the function for the given params. The resulting expression matches the type returned by get_returned_type.
Source§

impl<T0, R, F> Overload for FunctionOverload<F, (T0,), R, &mut CompileContext>
where T0: GeoType + 'static, R: GeoType + Into<AnyExpr> + 'static, F: Fn(T0, &mut CompileContext, Properties) -> R,

Source§

fn get_returned_type(&self, params: &[AnyExpr]) -> Option<Type>

Get the return type for the given parameters. Returns None if the overload cannot be called with these parameters.
Source§

fn unroll( &self, params: Vec<AnyExpr>, context: &mut CompileContext, props: Properties, ) -> AnyExpr

Unroll the function for the given params. The resulting expression matches the type returned by get_returned_type.
Source§

impl<T0, T1, R, F> Overload for FunctionOverload<F, (T0, T1), R, &CompileContext>
where T0: GeoType + 'static, T1: GeoType + 'static, R: GeoType + Into<AnyExpr> + 'static, F: Fn(T0, T1, &CompileContext, Properties) -> R,

Source§

fn get_returned_type(&self, params: &[AnyExpr]) -> Option<Type>

Get the return type for the given parameters. Returns None if the overload cannot be called with these parameters.
Source§

fn unroll( &self, params: Vec<AnyExpr>, context: &mut CompileContext, props: Properties, ) -> AnyExpr

Unroll the function for the given params. The resulting expression matches the type returned by get_returned_type.
Source§

impl<T0, T1, R, F> Overload for FunctionOverload<F, (T0, T1), R, &mut CompileContext>
where T0: GeoType + 'static, T1: GeoType + 'static, R: GeoType + Into<AnyExpr> + 'static, F: Fn(T0, T1, &mut CompileContext, Properties) -> R,

Source§

fn get_returned_type(&self, params: &[AnyExpr]) -> Option<Type>

Get the return type for the given parameters. Returns None if the overload cannot be called with these parameters.
Source§

fn unroll( &self, params: Vec<AnyExpr>, context: &mut CompileContext, props: Properties, ) -> AnyExpr

Unroll the function for the given params. The resulting expression matches the type returned by get_returned_type.
Source§

impl<T0, T1, T2, R, F> Overload for FunctionOverload<F, (T0, T1, T2), R, &CompileContext>
where T0: GeoType + 'static, T1: GeoType + 'static, T2: GeoType + 'static, R: GeoType + Into<AnyExpr> + 'static, F: Fn(T0, T1, T2, &CompileContext, Properties) -> R,

Source§

fn get_returned_type(&self, params: &[AnyExpr]) -> Option<Type>

Get the return type for the given parameters. Returns None if the overload cannot be called with these parameters.
Source§

fn unroll( &self, params: Vec<AnyExpr>, context: &mut CompileContext, props: Properties, ) -> AnyExpr

Unroll the function for the given params. The resulting expression matches the type returned by get_returned_type.
Source§

impl<T0, T1, T2, R, F> Overload for FunctionOverload<F, (T0, T1, T2), R, &mut CompileContext>
where T0: GeoType + 'static, T1: GeoType + 'static, T2: GeoType + 'static, R: GeoType + Into<AnyExpr> + 'static, F: Fn(T0, T1, T2, &mut CompileContext, Properties) -> R,

Source§

fn get_returned_type(&self, params: &[AnyExpr]) -> Option<Type>

Get the return type for the given parameters. Returns None if the overload cannot be called with these parameters.
Source§

fn unroll( &self, params: Vec<AnyExpr>, context: &mut CompileContext, props: Properties, ) -> AnyExpr

Unroll the function for the given params. The resulting expression matches the type returned by get_returned_type.
Source§

impl<T0, T1, T2, T3, R, F> Overload for FunctionOverload<F, (T0, T1, T2, T3), R, &CompileContext>
where T0: GeoType + 'static, T1: GeoType + 'static, T2: GeoType + 'static, T3: GeoType + 'static, R: GeoType + Into<AnyExpr> + 'static, F: Fn(T0, T1, T2, T3, &CompileContext, Properties) -> R,

Source§

fn get_returned_type(&self, params: &[AnyExpr]) -> Option<Type>

Get the return type for the given parameters. Returns None if the overload cannot be called with these parameters.
Source§

fn unroll( &self, params: Vec<AnyExpr>, context: &mut CompileContext, props: Properties, ) -> AnyExpr

Unroll the function for the given params. The resulting expression matches the type returned by get_returned_type.
Source§

impl<T0, T1, T2, T3, R, F> Overload for FunctionOverload<F, (T0, T1, T2, T3), R, &mut CompileContext>
where T0: GeoType + 'static, T1: GeoType + 'static, T2: GeoType + 'static, T3: GeoType + 'static, R: GeoType + Into<AnyExpr> + 'static, F: Fn(T0, T1, T2, T3, &mut CompileContext, Properties) -> R,

Source§

fn get_returned_type(&self, params: &[AnyExpr]) -> Option<Type>

Get the return type for the given parameters. Returns None if the overload cannot be called with these parameters.
Source§

fn unroll( &self, params: Vec<AnyExpr>, context: &mut CompileContext, props: Properties, ) -> AnyExpr

Unroll the function for the given params. The resulting expression matches the type returned by get_returned_type.

Auto Trait Implementations§

§

impl<F, A, R, C> Freeze for FunctionOverload<F, A, R, C>
where F: Freeze,

§

impl<F, A, R, C> RefUnwindSafe for FunctionOverload<F, A, R, C>

§

impl<F, A, R, C> Send for FunctionOverload<F, A, R, C>
where F: Send, A: Send, R: Send, C: Send,

§

impl<F, A, R, C> Sync for FunctionOverload<F, A, R, C>
where F: Sync, A: Sync, R: Sync, C: Sync,

§

impl<F, A, R, C> Unpin for FunctionOverload<F, A, R, C>
where F: Unpin, A: Unpin, R: Unpin, C: Unpin,

§

impl<F, A, R, C> UnwindSafe for FunctionOverload<F, A, R, C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Convert for T

Source§

fn convert<U>(self, context: &CompileContext) -> Expr<U>
where U: ConvertFrom<T>,

Convert self into a specific type. Read more
Source§

fn can_convert<U>(&self) -> bool
where U: ConvertFrom<T>,

Check if self can be converted into a specific type. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoOverload<T> for T
where T: Overload + 'static,

Source§

type Target = T

Target overload type
Source§

fn into_overload(self) -> <T as IntoOverload<T>>::Target

Turn this into a function overload.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.