pub struct Builder { /* private fields */ }

Implementations§

source§

impl Builder

source

pub fn new() -> Builder

source

pub fn vis<V: Make<Visibility>>(self, vis: V) -> Self

source

pub fn pub_(self) -> Self

source

pub fn set_mutbl<M: Make<Mutability>>(self, mutbl: M) -> Self

source

pub fn mutbl(self) -> Self

source

pub fn unsafety<U: Make<Unsafety>>(self, unsafety: U) -> Self

source

pub fn unsafe_(self) -> Self

source

pub fn constness<C: Make<Constness>>(self, constness: C) -> Self

source

pub fn const_(self) -> Self

source

pub fn extern_<A: Make<Extern>>(self, ext: A) -> Self

source

pub fn span<S: Make<Span>>(self, span: S) -> Self

source

pub fn generic_over(self, param: GenericParam) -> Self

source

pub fn prepare_meta_namevalue(&self, mnv: MetaNameValue) -> PreparedMetaItem

source

pub fn prepare_meta_list(&self, list: MetaList) -> PreparedMetaItem

source

pub fn prepare_meta_path<I>(&self, path: I) -> PreparedMetaItemwhere I: Make<Path>,

source

pub fn prepare_meta(&self, kind: Meta) -> PreparedMetaItem

source

pub fn prepare_nested_meta_item<I>( &self, path: I, kind: Meta ) -> PreparedMetaItemwhere I: Make<Path>,

source

pub fn prepared_attr(self, prepared: PreparedMetaItem) -> Self

source

pub fn str_attr<K, V>(self, key: K, value: V) -> Selfwhere K: Make<Path>, V: Make<Lit>,

source

pub fn single_attr<K>(self, key: K) -> Selfwhere K: Make<PathSegment>,

source

pub fn call_attr<K, V>(self, func: K, arguments: Vec<V>) -> Selfwhere K: Make<PathSegment>, V: Make<Ident>,

source

pub fn path_segment_with_args<I, P>(self, identifier: I, args: P) -> PathSegmentwhere I: Make<Ident>, P: Make<PathArguments>,

source

pub fn parenthesized_args( self, tys: Vec<Box<Type>> ) -> ParenthesizedGenericArguments

source

pub fn angle_bracketed_args<A>( self, args: Vec<A> ) -> AngleBracketedGenericArgumentswhere A: Make<GenericArgument>,

source

pub fn generic_arg<A>(self, arg: A) -> GenericArgumentwhere A: Make<GenericArgument>,

source

pub fn ident<I>(self, name: I) -> Identwhere I: Make<Ident>,

source

pub fn path_segment<S>(self, seg: S) -> PathSegmentwhere S: Make<PathSegment>,

source

pub fn path<Pa>(self, path: Pa) -> Pathwhere Pa: Make<Path>,

source

pub fn use_tree<Pa>(self, prefix: Pa, tree: UseTree) -> UseTreewhere Pa: Make<Path>,

source

pub fn abs_path<Pa>(self, path: Pa) -> Pathwhere Pa: Make<Path>,

source

pub fn array_expr(self, args: Vec<Box<Expr>>) -> Box<Expr>

source

pub fn call_expr(self, func: Box<Expr>, args: Vec<Box<Expr>>) -> Box<Expr>

source

pub fn method_call_expr<S>( self, expr: Box<Expr>, seg: S, args: Vec<Box<Expr>> ) -> Box<Expr>where S: Make<PathSegment>,

source

pub fn tuple_expr(self, exprs: Vec<Box<Expr>>) -> Box<Expr>

source

pub fn binary_expr(self, op: BinOp, lhs: Box<Expr>, rhs: Box<Expr>) -> Box<Expr>

source

pub fn unary_expr<O>(self, op: O, a: Box<Expr>) -> Box<Expr>where O: Make<UnOp>,

source

pub fn lit_expr<L>(self, lit: L) -> Box<Expr>where L: Make<Lit>,

source

pub fn cast_expr(self, e: Box<Expr>, t: Box<Type>) -> Box<Expr>

source

pub fn type_expr(self, e: Box<Expr>, t: Box<Type>) -> Box<Expr>

source

pub fn unsafe_block_expr(self, unsafe_blk: ExprUnsafe) -> Box<Expr>

source

pub fn block_expr(self, block: Block) -> Box<Expr>

source

pub fn labelled_block_expr<L>(self, block: Block, lbl: L) -> Box<Expr>where L: Make<Label>,

source

pub fn assign_expr(self, lhs: Box<Expr>, rhs: Box<Expr>) -> Box<Expr>

source

pub fn assign_op_expr( self, op: BinOp, lhs: Box<Expr>, rhs: Box<Expr> ) -> Box<Expr>

source

pub fn index_expr(self, lhs: Box<Expr>, rhs: Box<Expr>) -> Box<Expr>

source

pub fn abs_path_expr<Pa>(self, path: Pa) -> Box<Expr>where Pa: Make<Path>,

source

pub fn path_expr<Pa>(self, path: Pa) -> Box<Expr>where Pa: Make<Path>,

source

pub fn qpath_expr<Pa>(self, qself: Option<QSelf>, path: Pa) -> Box<Expr>where Pa: Make<Path>,

source

pub fn repeat_expr(self, expr: Box<Expr>, n: Box<Expr>) -> Box<Expr>

An array literal constructed from one repeated element. [expr; n]

source

pub fn paren_expr(self, e: Box<Expr>) -> Box<Expr>

source

pub fn ident_expr<I>(self, name: I) -> Box<Expr>where I: Make<Ident>,

source

pub fn addr_of_expr(self, e: Box<Expr>) -> Box<Expr>

source

pub fn mac_expr(self, mac: Macro) -> Box<Expr>

source

pub fn struct_expr<Pa>(self, path: Pa, fields: Vec<FieldValue>) -> Box<Expr>where Pa: Make<Path>,

source

pub fn struct_expr_base<Pa>( self, path: Pa, fields: Vec<FieldValue>, base: Option<Box<Expr>> ) -> Box<Expr>where Pa: Make<Path>,

source

pub fn field_expr<F>(self, val: Box<Expr>, field: F) -> Box<Expr>where F: Make<Ident>,

source

pub fn anon_field_expr(self, val: Box<Expr>, field: u32) -> Box<Expr>

source

pub fn field<I>(self, ident: I, expr: Box<Expr>) -> FieldValuewhere I: Make<Ident>,

source

pub fn match_expr(self, cond: Box<Expr>, arms: Vec<Arm>) -> Box<Expr>

source

pub fn arm(self, pat: Pat, guard: Option<Box<Expr>>, body: Box<Expr>) -> Arm

source

pub fn int_lit(self, i: u128, ty: &str) -> Lit

source

pub fn int_unsuffixed_lit(self, i: u128) -> Lit

source

pub fn float_lit(self, s: &str, ty: &str) -> Lit

source

pub fn float_unsuffixed_lit(self, s: &str) -> Lit

source

pub fn bool_lit(self, b: bool) -> Lit

source

pub fn ifte_expr( self, cond: Box<Expr>, then_branch: Block, else_branch: Option<Box<Expr>> ) -> Box<Expr>

source

pub fn while_expr<I>( self, cond: Box<Expr>, body: Block, label: Option<I> ) -> Box<Expr>where I: Make<Ident>,

source

pub fn loop_expr<I>(self, body: Block, label: Option<I>) -> Box<Expr>where I: Make<Ident>,

source

pub fn for_expr<I>( self, pat: Pat, expr: Box<Expr>, body: Block, label: Option<I> ) -> Box<Expr>where I: Make<Ident>,

source

pub fn ident_pat<I>(self, name: I) -> Patwhere I: Make<Ident>,

source

pub fn tuple_pat(self, pats: Vec<Pat>) -> Pat

source

pub fn qpath_pat<Pa>(self, qself: Option<QSelf>, path: Pa) -> Box<Pat>where Pa: Make<Path>,

source

pub fn wild_pat(self) -> Pat

source

pub fn lit_pat(self, lit: Box<Expr>) -> Pat

source

pub fn mac_pat(self, mac: Macro) -> Pat

source

pub fn ident_ref_pat<I>(self, name: I) -> Patwhere I: Make<Ident>,

source

pub fn or_pat(self, pats: Vec<Pat>) -> Pat

source

pub fn barefn_ty( self, decl: (Vec<BareFnArg>, Option<Variadic>, ReturnType) ) -> Box<Type>

source

pub fn array_ty(self, ty: Box<Type>, len: Box<Expr>) -> Box<Type>

source

pub fn slice_ty(self, ty: Box<Type>) -> Box<Type>

source

pub fn ptr_ty(self, ty: Box<Type>) -> Box<Type>

source

pub fn ref_ty(self, ty: Box<Type>) -> Box<Type>

source

pub fn ref_lt_ty<L>(self, lt: L, ty: Box<Type>) -> Box<Type>where L: Make<Lifetime>,

source

pub fn never_ty(self) -> Box<Type>

source

pub fn tuple_ty(self, elem_tys: Vec<Box<Type>>) -> Box<Type>

source

pub fn path_ty<Pa>(self, path: Pa) -> Box<Type>where Pa: Make<Path>,

source

pub fn qpath_ty<Pa>(self, qself: Option<QSelf>, path: Pa) -> Box<Type>where Pa: Make<Path>,

source

pub fn ident_ty<I>(self, name: I) -> Box<Type>where I: Make<Ident>,

source

pub fn infer_ty(self) -> Box<Type>

source

pub fn mac_ty(self, mac: Macro) -> Box<Type>

source

pub fn cvar_args_ty(self) -> Box<Type>

source

pub fn local_stmt(self, local: Box<Local>) -> Stmt

source

pub fn expr_stmt(self, expr: Box<Expr>) -> Stmt

source

pub fn semi_stmt(self, expr: Box<Expr>) -> Stmt

source

pub fn item_stmt(self, item: Box<Item>) -> Stmt

source

pub fn mac_stmt(self, mac: Macro) -> Stmt

source

pub fn static_item<I>( self, name: I, ty: Box<Type>, init: Box<Expr> ) -> Box<Item>where I: Make<Ident>,

source

pub fn const_item<I>(self, name: I, ty: Box<Type>, init: Box<Expr>) -> Box<Item>where I: Make<Ident>,

source

pub fn fn_item<S>(self, sig: S, block: Block) -> Box<Item>where S: Make<Signature>,

source

pub fn variadic_arg(self, variadic_attrs: Vec<Attribute>) -> Variadic

source

pub fn fn_decl<I>( self, name: I, inputs: Vec<FnArg>, variadic: Option<Variadic>, output: ReturnType ) -> Box<(Ident, Vec<FnArg>, Option<Variadic>, ReturnType)>where I: Make<Ident>,

source

pub fn struct_item<I>( self, name: I, fields: Vec<Field>, is_tuple: bool ) -> Box<Item>where I: Make<Ident>,

source

pub fn union_item<I>(self, name: I, fields: Vec<Field>) -> Box<Item>where I: Make<Ident>,

source

pub fn enum_item<I>(self, name: I, fields: Vec<Variant>) -> Box<Item>where I: Make<Ident>,

source

pub fn type_item<I>(self, name: I, ty: Box<Type>) -> Box<Item>where I: Make<Ident>,

source

pub fn mod_item<I>(self, name: I, items: Option<Vec<Item>>) -> Box<Item>where I: Make<Ident>,

source

pub fn mod_(self, items: Vec<Box<Item>>) -> Vec<Item>

source

pub fn mac_item(self, mac: Macro) -> Box<Item>

source

pub fn variant<I>(self, name: I, fields: Fields) -> Variantwhere I: Make<Ident>,

source

pub fn unit_variant<I>(self, name: I, disc: Option<Box<Expr>>) -> Variantwhere I: Make<Ident>,

source

pub fn impl_item(self, ty: Box<Type>, items: Vec<ImplItem>) -> Box<Item>

source

pub fn extern_crate_item<I>(self, name: I, rename: Option<I>) -> Box<Item>where I: Make<Ident>,

source

pub fn use_item(self, tree: UseTree) -> Box<Item>

source

pub fn use_simple_item<Pa, I>(self, path: Pa, rename: Option<I>) -> Box<Item>where Pa: Make<Path>, I: Make<Ident>,

source

pub fn use_multiple_item<Pa, I, It>(self, path: Pa, inner: It) -> Box<Item>where Pa: Make<Path>, I: Make<Ident>, It: Iterator<Item = I>,

source

pub fn use_glob_item<Pa>(self, path: Pa) -> Box<Item>where Pa: Make<Path>,

source

pub fn foreign_items(self, items: Vec<ForeignItem>) -> Box<Item>

source

pub fn get_abi(&self) -> Abi

source

pub fn get_abi_opt(&self) -> Option<Abi>

source

pub fn mac_impl_item(self, mac: Macro) -> ImplItem

source

pub fn mac_trait_item(self, mac: Macro) -> TraitItem

source

pub fn fn_foreign_item( self, decl: Box<(Ident, Vec<FnArg>, Option<Variadic>, ReturnType)> ) -> Box<ForeignItem>

ForeignItem is large (472 bytes), so Box it.

source

pub fn static_foreign_item<I>(self, name: I, ty: Box<Type>) -> Box<ForeignItem>where I: Make<Ident>,

ForeignItem is large (472 bytes), so Box it.

source

pub fn ty_foreign_item<I>(self, name: I) -> Box<ForeignItem>where I: Make<Ident>,

ForeignItem is large (472 bytes), so Box it.

source

pub fn mac_foreign_item(self, mac: Macro) -> ForeignItem

source

pub fn struct_field<I>(self, ident: I, ty: Box<Type>) -> Fieldwhere I: Make<Ident>,

source

pub fn enum_field(self, ty: Box<Type>) -> Field

source

pub fn unsafe_block(self, stmts: Vec<Stmt>) -> ExprUnsafe

source

pub fn block(self, stmts: Vec<Stmt>) -> Block

source

pub fn label<L>(self, lbl: L) -> Labelwhere L: Make<Label>,

source

pub fn break_expr_value<L>( self, label: Option<L>, value: Option<Box<Expr>> ) -> Box<Expr>where L: Make<Label>,

source

pub fn bare_arg<I>(self, ty: Box<Type>, name: Option<I>) -> BareFnArgwhere I: Make<Box<Ident>>,

source

pub fn arg(self, ty: Box<Type>, pat: Pat) -> FnArg

source

pub fn self_arg(self, kind: SelfKind) -> FnArg

source

pub fn ty_param<I>(self, ident: I) -> GenericParamwhere I: Make<Ident>,

source

pub fn ty<T>(self, kind: Type) -> Type

source

pub fn lt_param<L>(self, lifetime: L) -> GenericParamwhere L: Make<Lifetime>,

source

pub fn lifetime<L: Make<Lifetime>>(self, lt: L) -> Lifetime

source

pub fn attribute<Pa, Ma>( self, style: AttrStyle, path: Pa, args: Ma ) -> Attributewhere Pa: Make<Path>, Ma: Make<TokenStream>,

source

pub fn meta_item_attr(self, style: AttrStyle, meta_item: Meta) -> Self

source

pub fn meta_path<Pa>(self, path: Pa) -> Metawhere Pa: Make<Path>,

source

pub fn meta_list<I, N>(self, path: I, args: N) -> Metawhere I: Make<Path>, N: Make<Vec<NestedMeta>>,

source

pub fn meta_namevalue<K, V>(self, key: K, value: V) -> Metawhere K: Make<Path>, V: Make<Lit>,

source

pub fn nested_meta_item<K>(self, kind: K) -> NestedMetawhere K: Make<NestedMeta>,

source

pub fn as_inner_attrs(self) -> Vec<Attribute>

source

pub fn into_attrs(self) -> Vec<Attribute>

source

pub fn empty_mac<Pa>(self, path: Pa, delim: MacroDelimiter) -> Macrowhere Pa: Make<Path>,

source

pub fn mac<Ts>(self, func: Path, arguments: Ts, delim: MacroDelimiter) -> Macrowhere Ts: Make<TokenStream>,

source

pub fn local( self, pat: Pat, ty: Option<Box<Type>>, init: Option<Box<Expr>> ) -> Local

Create a local variable

source

pub fn return_expr(self, val: Option<Box<Expr>>) -> Box<Expr>

source

pub fn continue_expr<I>(self, label: Option<I>) -> Box<Expr>where I: Make<Ident>,

source

pub fn break_expr<I>(self, label: Option<I>) -> Box<Expr>where I: Make<Ident>,

source

pub fn closure_expr( self, capture: CaptureBy, mov: Movability, decl: (Ident, Vec<FnArg>, Option<Variadic>, ReturnType), body: Box<Expr> ) -> Box<Expr>

Trait Implementations§

source§

impl Clone for Builder

source§

fn clone(&self) -> Builder

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 Debug for Builder

source§

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

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

impl Default for Builder

source§

fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> Make<T> for T

source§

fn make(self, _mk: &Builder) -> T

source§

impl<T> ToOwned for Twhere 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 Twhere 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 Twhere 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.