Struct upon::SyntaxBuilder

source ·
pub struct SyntaxBuilder<'a> { /* private fields */ }
Expand description

A builder for the syntax configuration.

This struct is typically created using Syntax::builder().

Implementations§

source§

impl<'a> SyntaxBuilder<'a>

source

pub fn new() -> Self

Creates a new syntax builder.

source

pub fn expr(&mut self, begin_expr: &'a str, end_expr: &'a str) -> &mut Self

Set the block syntax.

If not set then the expression syntax will not be available.

§Panics

If either of the strings are empty.

source

pub fn block(&mut self, begin_block: &'a str, end_block: &'a str) -> &mut Self

Set the block syntax.

If not set then the block syntax will not be available.

§Panics

If either of the strings are empty.

source

pub fn comment( &mut self, begin_comment: &'a str, end_comment: &'a str ) -> &mut Self

Set the comment syntax.

If not set then comment syntax will not be available.

§Panics

If either of the strings are empty.

source

pub fn build(&self) -> Syntax<'a>

Builds the syntax configuration.

Trait Implementations§

source§

impl<'a> Clone for SyntaxBuilder<'a>

source§

fn clone(&self) -> SyntaxBuilder<'a>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for SyntaxBuilder<'a>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for SyntaxBuilder<'a>

§

impl<'a> Send for SyntaxBuilder<'a>

§

impl<'a> Sync for SyntaxBuilder<'a>

§

impl<'a> Unpin for SyntaxBuilder<'a>

§

impl<'a> UnwindSafe for SyntaxBuilder<'a>

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

§

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>,

§

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>,

§

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.