pub struct Signature {
pub ret: Ty,
pub params: Vec<Ty>,
pub variadic: bool,
pub prototyped: bool,
}Expand description
A function’s signature.
Fields§
§ret: TyThe return type.
params: Vec<Ty>The parameter types.
variadic: boolWhether the prototype ended with , ....
prototyped: boolWhether a parameter type list was given at all; see
FuncType::prototyped.
int f(); before C23 declares a function whose parameters are
unspecified: params is empty because nothing was said, not because
there are none. A definition written that way does take no parameters
— that is what the generated item has — but its type still has no
prototype, so a call with arguments is legal C and reaches the callee
with the default argument promotions applied.
Trait Implementations§
impl Eq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnsafeUnpin for Signature
impl UnwindSafe for Signature
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