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>>
Implementations§
Source§impl DocumentationBuilder
impl DocumentationBuilder
pub fn new() -> Self
pub fn with_doc_section(self, doc_section: DocSection) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_syntax_example(self, syntax_example: impl Into<String>) -> Self
pub fn with_sql_example(self, sql_example: impl Into<String>) -> Self
Sourcepub fn with_argument(
self,
arg_name: impl Into<String>,
arg_description: impl Into<String>,
) -> Self
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.
Sourcepub fn with_standard_argument(
self,
arg_name: impl Into<String>,
expression_type: Option<&str>,
) -> Self
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.
pub fn with_alternative_syntax(self, syntax_name: impl Into<String>) -> Self
pub fn build(self) -> Result<Documentation>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DocumentationBuilder
impl RefUnwindSafe for DocumentationBuilder
impl Send for DocumentationBuilder
impl Sync for DocumentationBuilder
impl Unpin for DocumentationBuilder
impl UnwindSafe for DocumentationBuilder
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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