datafusion_expr

Struct DocumentationBuilder

Source
pub struct DocumentationBuilder {
    pub doc_section: Option<DocSection>,
    pub description: Option<String>,
    pub syntax_example: Option<String>,
    pub sql_example: Option<String>,
    pub arguments: Option<Vec<(String, String)>>,
    pub alternative_syntax: Option<Vec<String>>,
    pub related_udfs: Option<Vec<String>>,
}
Expand description

A builder to be used for building Documentation’s.

Example:

      let documentation = Documentation::builder()
          .with_doc_section(DOC_SECTION_MATH)
          .with_description("Add one to an int32")
          .with_syntax_example("add_one(2)")
          .with_argument("arg_1", "The int32 number to add one to")
          .build()?;
      Ok(())  

Fields§

§doc_section: Option<DocSection>§description: Option<String>§syntax_example: Option<String>§sql_example: Option<String>§arguments: Option<Vec<(String, String)>>§alternative_syntax: Option<Vec<String>>§related_udfs: Option<Vec<String>>

Implementations§

Source§

impl DocumentationBuilder

Source

pub fn new() -> Self

Source

pub fn with_doc_section(self, doc_section: DocSection) -> Self

Source

pub fn with_description(self, description: impl Into<String>) -> Self

Source

pub fn with_syntax_example(self, syntax_example: impl Into<String>) -> Self

Source

pub fn with_sql_example(self, sql_example: impl Into<String>) -> Self

Source

pub fn with_argument( self, arg_name: impl Into<String>, arg_description: impl Into<String>, ) -> Self

Adds documentation for a specific argument to the documentation.

Arguments are displayed in the order they are added.

Source

pub fn with_standard_argument( self, arg_name: impl Into<String>, expression_type: Option<&str>, ) -> Self

Add a standard “expression” argument to the documentation

The argument is rendered like below if Some() is passed through:

<arg_name>:
  <expression_type> expression to operate on. Can be a constant, column, or function, and any combination of operators.

The argument is rendered like below if None is passed through:

<arg_name>:
 The expression to operate on. Can be a constant, column, or function, and any combination of operators.
Source

pub fn with_alternative_syntax(self, syntax_name: impl Into<String>) -> Self

Source

pub fn build(self) -> Result<Documentation>

Trait Implementations§

Source§

impl Default for DocumentationBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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.
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,