#[derive(Clone, PartialEq, Eq, Hash, Serialize, Debug)] #[non_exhaustive] /// Represents a free function not associated with any types. pubstruct Function { pub name: Ident, pub abi_name: Ident, // corresponds to the types in Function(Vec<Box<TypeName>>, Box<TypeName>) // the callback type; except here the params aren't anonymous pub params: Vec<Param>, pub output_type: Option<TypeName>, pub lifetimes: LifetimeEnv, pub attrs: Attrs, pub docs: Docs,
}
impl Function { pub(crate) fn from_syn(f: &ItemFn, parent_attrs: &Attrs) -> Function { let ident: Ident = (&f.sig.ident).into(); if f.sig.receiver().is_some() {
panic!("Cannot use self parameter in free function {ident:?}")
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.