struct FunctionBuilder {
target: GeneratedFunctionTarget,
fn_name: Name,
generic_param_list: Option<GenericParamList>,
where_clause: Option<WhereClause>,
params: ParamList,
fn_body: BlockExpr,
ret_type: Option<RetType>,
should_focus_return_type: bool,
visibility: Visibility,
is_async: bool,
target_edition: Edition,
}Fields§
§target: GeneratedFunctionTarget§fn_name: Name§generic_param_list: Option<GenericParamList>§where_clause: Option<WhereClause>§params: ParamList§fn_body: BlockExpr§ret_type: Option<RetType>§should_focus_return_type: bool§visibility: Visibility§is_async: bool§target_edition: EditionImplementations§
Source§impl FunctionBuilder
impl FunctionBuilder
Sourcefn from_call(
make: &SyntaxFactory,
ctx: &AssistContext<'_, '_>,
call: &CallExpr,
fn_name: &str,
target_module: Option<Module>,
target: GeneratedFunctionTarget,
adt_info: &Option<AdtInfo>,
) -> Option<Self>
fn from_call( make: &SyntaxFactory, ctx: &AssistContext<'_, '_>, call: &CallExpr, fn_name: &str, target_module: Option<Module>, target: GeneratedFunctionTarget, adt_info: &Option<AdtInfo>, ) -> Option<Self>
Prepares a generated function that matches call.
The function is generated in target_module or next to call
fn from_method_call( make: &SyntaxFactory, ctx: &AssistContext<'_, '_>, call: &MethodCallExpr, name: &NameRef, receiver_ty: Type<'_>, target_module: Module, target: GeneratedFunctionTarget, ) -> Option<Self>
fn render(&self, make: &SyntaxFactory) -> Fn
Auto Trait Implementations§
impl Freeze for FunctionBuilder
impl !RefUnwindSafe for FunctionBuilder
impl !Send for FunctionBuilder
impl !Sync for FunctionBuilder
impl Unpin for FunctionBuilder
impl UnsafeUnpin for FunctionBuilder
impl !UnwindSafe for FunctionBuilder
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
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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