pub struct ServiceMethod {
pub attributes: Any<RawAttribute>,
pub _async: KAsync,
pub _fn: KFn,
pub name: Ident,
pub generics: Optional<GenericParams>,
pub params: ParenthesisGroupContaining<MethodParams>,
pub return_type: Optional<ReturnType>,
pub where_clause: Optional<WhereClause>,
pub _semi: Semicolon,
}Fields§
§attributes: Any<RawAttribute>§_async: KAsync§_fn: KFn§name: Ident§generics: Optional<GenericParams>§params: ParenthesisGroupContaining<MethodParams>§return_type: Optional<ReturnType>§where_clause: Optional<WhereClause>§_semi: SemicolonImplementations§
Source§impl ServiceMethod
impl ServiceMethod
Sourcepub fn doc(&self) -> Option<String>
pub fn doc(&self) -> Option<String>
Get the method’s doc string (collected from #[doc = “…”] attributes).
Sourcepub fn args(&self) -> impl Iterator<Item = &MethodParam>
pub fn args(&self) -> impl Iterator<Item = &MethodParam>
Get an iterator over the method’s parameters (excluding &self).
Sourcepub fn return_type(&self) -> Type
pub fn return_type(&self) -> Type
Get the return type, defaulting to () if not specified.
Sourcepub fn is_mut_receiver(&self) -> bool
pub fn is_mut_receiver(&self) -> bool
Check if receiver is &mut self (not allowed for service methods).
Sourcepub fn has_generics(&self) -> bool
pub fn has_generics(&self) -> bool
Check if method has generics.
Trait Implementations§
Source§impl Debug for ServiceMethod
impl Debug for ServiceMethod
Source§impl Parser for ServiceMethod
impl Parser for ServiceMethod
Source§impl ToTokens for ServiceMethod
impl ToTokens for ServiceMethod
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
Source§fn to_token_iter(&self) -> TokenIter
fn to_token_iter(&self) -> TokenIter
Convert
&self into a TokenIter object.Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Convert
&self into a TokenStream object.Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
Convert
self into a TokenStream object.Auto Trait Implementations§
impl Freeze for ServiceMethod
impl RefUnwindSafe for ServiceMethod
impl !Send for ServiceMethod
impl !Sync for ServiceMethod
impl Unpin for ServiceMethod
impl UnsafeUnpin for ServiceMethod
impl UnwindSafe for ServiceMethod
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> DynamicTokens for T
impl<T> DynamicTokens for T
Source§impl<T> Parse for Twhere
T: Parser,
impl<T> Parse for Twhere
T: Parser,
Source§fn parse(tokens: &mut TokenIter) -> Result<Self, Error>
fn parse(tokens: &mut TokenIter) -> Result<Self, Error>
This is the user facing API to parse grammatical entities. Calls a
parser() within a
transaction. Commits changes on success and returns the parsed value. Read more