Skip to main content

Function

Enum Function 

Source
#[non_exhaustive]
pub enum Function {
Show 129 variants Iif, IsNull, IsNullOrEmpty, Ascii, Char, CharIndex, Concat, Contains, EndsWith, Insert, Len, Lower, NewLine, PadLeft, PadRight, Remove, Replace, Reverse, StartsWith, Substring, ToStr, Trim, Upper, Abs, Acos, Asin, Atn, Atn2, BigMul, Ceiling, Cos, Cosh, Exp, Floor, Log, Log10, Max2, Min2, Power, Rnd, Round, Sign, Sin, Sinh, Sqr, Sqrt, Tan, Tanh, ToDecimal, ToDouble, ToFloat, ToInt, ToLong, ToNumber, AddDays, AddHours, AddMinutes, AddMonths, AddSeconds, AddYears, DateDiffDay, DateDiffHour, DateDiffMinute, DateDiffMonth, DateDiffSecond, DateDiffYear, DateTimeFromParts, GetDate, GetDay, GetDayOfWeek, GetDayOfYear, GetHour, GetMinute, GetMonth, GetSecond, GetYear, Now, Today, UtcNow, LocalDateTimeToday, LocalDateTimeNow, LocalDateTimeTomorrow, LocalDateTimeYesterday, LocalDateTimeDayAfterTomorrow, LocalDateTimeThisWeek, LocalDateTimeLastWeek, LocalDateTimeNextWeek, LocalDateTimeTwoWeeksAway, LocalDateTimeThisMonth, LocalDateTimeLastMonth, LocalDateTimeNextMonth, LocalDateTimeTwoMonthsAway, LocalDateTimeThisYear, LocalDateTimeLastYear, LocalDateTimeNextYear, LocalDateTimeTwoYearsAway, LocalDateTimeYearBeforeToday, InDateRange, InTimeRange, OutOfTimeRange, IsSameDay, IsThisWeek, IsThisMonth, IsLastMonth, IsNextMonth, IsThisYear, IsLastYear, IsNextYear, IsYearToDate, IsJanuary, IsFebruary, IsMarch, IsApril, IsMay, IsJune, IsJuly, IsAugust, IsSeptember, IsOctober, IsNovember, IsDecember, FormatString, Rgb, Argb, PageNumber, PageCount, CurrentRowIndexInGroup, PrevRowColumnValue, NextRowColumnValue,
}
Expand description

The built-in scalar functions. Names are case-insensitive in expressions.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Iif

§

IsNull

§

IsNullOrEmpty

§

Ascii

§

Char

§

CharIndex

§

Concat

§

Contains

§

EndsWith

§

Insert

§

Len

§

Lower

§

NewLine

§

PadLeft

§

PadRight

§

Remove

§

Replace

§

Reverse

§

StartsWith

§

Substring

§

ToStr

§

Trim

§

Upper

§

Abs

§

Acos

§

Asin

§

Atn

§

Atn2

§

BigMul

§

Ceiling

§

Cos

§

Cosh

§

Exp

§

Floor

§

Log

§

Log10

§

Max2

§

Min2

§

Power

§

Rnd

§

Round

§

Sign

§

Sin

§

Sinh

§

Sqr

§

Sqrt

§

Tan

§

Tanh

§

ToDecimal

§

ToDouble

§

ToFloat

§

ToInt

§

ToLong

§

ToNumber

§

AddDays

§

AddHours

§

AddMinutes

§

AddMonths

§

AddSeconds

§

AddYears

§

DateDiffDay

§

DateDiffHour

§

DateDiffMinute

§

DateDiffMonth

§

DateDiffSecond

§

DateDiffYear

§

DateTimeFromParts

§

GetDate

§

GetDay

§

GetDayOfWeek

§

GetDayOfYear

§

GetHour

§

GetMinute

§

GetMonth

§

GetSecond

§

GetYear

§

Now

§

Today

§

UtcNow

§

LocalDateTimeToday

§

LocalDateTimeNow

§

LocalDateTimeTomorrow

§

LocalDateTimeYesterday

§

LocalDateTimeDayAfterTomorrow

§

LocalDateTimeThisWeek

§

LocalDateTimeLastWeek

§

LocalDateTimeNextWeek

§

LocalDateTimeTwoWeeksAway

§

LocalDateTimeThisMonth

§

LocalDateTimeLastMonth

§

LocalDateTimeNextMonth

§

LocalDateTimeTwoMonthsAway

§

LocalDateTimeThisYear

§

LocalDateTimeLastYear

§

LocalDateTimeNextYear

§

LocalDateTimeTwoYearsAway

§

LocalDateTimeYearBeforeToday

§

InDateRange

§

InTimeRange

§

OutOfTimeRange

§

IsSameDay

§

IsThisWeek

§

IsThisMonth

§

IsLastMonth

§

IsNextMonth

§

IsThisYear

§

IsLastYear

§

IsNextYear

§

IsYearToDate

§

IsJanuary

§

IsFebruary

§

IsMarch

§

IsApril

§

IsMay

§

IsJune

§

IsJuly

§

IsAugust

§

IsSeptember

§

IsOctober

§

IsNovember

§

IsDecember

§

FormatString

§

Rgb

§

Argb

§

PageNumber

§

PageCount

§

CurrentRowIndexInGroup

§

PrevRowColumnValue

§

NextRowColumnValue

Implementations§

Source§

impl Function

Source

pub fn info(self) -> &'static FunctionInfo

The catalog entry.

Source

pub fn name(self) -> &'static str

The name, as written in expressions.

Source

pub fn arity(self) -> (usize, usize)

The fewest and most arguments it takes.

Source

pub fn from_name(name: &str) -> Option<Self>

The function with this name, in any case. Min and Max are the two-argument forms; with one argument they are aggregates.

Source

pub fn all() -> impl Iterator<Item = Function>

Every built-in function.

Trait Implementations§

Source§

impl Clone for Function

Source§

fn clone(&self) -> Function

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Function

Source§

impl Debug for Function

Source§

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

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

impl Eq for Function

Source§

impl Hash for Function

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Function

Source§

fn eq(&self, other: &Function) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Function

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.