pub struct Function {
pub name: Ident,
pub params: Vec<Param>,
pub ret: TypeRef,
pub origin: Origin<ItemFn>,
}Expand description
A #[prebindgen] free function.
Fields§
§name: Ident§params: Vec<Param>Parameters in declaration order.
ret: TypeRefWhat the function returns. An elided return is
TypeKind::Unit, exactly as a written -> () is:
they mean the same thing, differ only in spelling, and every consumer
today already normalizes one to the other on the spot.
origin: Origin<ItemFn>The whole item: attributes, cfg, doc comments, body.
Implementations§
Source§impl Function
impl Function
Sourcepub fn synthetic_getter(ident: Ident, ret: TypeRef) -> Self
pub fn synthetic_getter(ident: Ident, ret: TypeRef) -> Self
A synthesized nullary getter: pub fn <ident>() -> <ret>.
The model’s own constructor for the one element an adapter legitimately
needs to invent — a declared const’s accessor, whose type flows through
the ordinary output-converter machinery and so has to arrive as a
Function like any other.
It lives here because building one means spelling ret, and #280
says a TypeRef is the model’s to mint. An adapter that built this
itself needed a spelling for a model element — which dragged the
emission capability into validation and Kotlin rendering, both of which
only wanted the resulting Function.
The body is unimplemented!() and is never emitted: only the signature
is read.
Trait Implementations§
Auto Trait Implementations§
impl !Send for Function
impl !Sync for Function
impl Freeze for Function
impl RefUnwindSafe for Function
impl Unpin for Function
impl UnsafeUnpin for Function
impl UnwindSafe for Function
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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