pub struct FunctionType {
pub abi: CallConv,
pub params: SmallVec<[Type; 4]>,
pub results: SmallVec<[Type; 1]>,
}Expand description
This represents the type of a function, i.e. it’s parameters and results, and expected calling convention.
Function types are reference types, i.e. they are always implicitly a handle/pointer to a function, not a function value.
Fields§
§abi: CallConvThe calling convention/ABI of the function represented by this type
params: SmallVec<[Type; 4]>The parameter types of this function
results: SmallVec<[Type; 1]>The result types of this function
Implementations§
Source§impl FunctionType
impl FunctionType
Sourcepub fn new<P: IntoIterator<Item = Type>, R: IntoIterator<Item = Type>>(
abi: CallConv,
params: P,
results: R,
) -> Self
pub fn new<P: IntoIterator<Item = Type>, R: IntoIterator<Item = Type>>( abi: CallConv, params: P, results: R, ) -> Self
Create a new function type with the given calling/convention ABI
Sourcepub fn with_calling_convention(self, abi: CallConv) -> Self
pub fn with_calling_convention(self, abi: CallConv) -> Self
Set the calling convention/ABI for this function type
Sourcepub fn calling_convention(&self) -> CallConv
pub fn calling_convention(&self) -> CallConv
The calling convention/ABI represented by this function type
Trait Implementations§
Source§impl Clone for FunctionType
impl Clone for FunctionType
Source§fn clone(&self) -> FunctionType
fn clone(&self) -> FunctionType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FunctionType
impl Debug for FunctionType
Source§impl<'de> Deserialize<'de> for FunctionType
impl<'de> Deserialize<'de> for FunctionType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for FunctionType
impl Display for FunctionType
Source§impl From<FunctionType> for Type
impl From<FunctionType> for Type
Source§fn from(ty: FunctionType) -> Type
fn from(ty: FunctionType) -> Type
Converts to this type from the input type.
Source§impl Hash for FunctionType
impl Hash for FunctionType
Source§impl PartialEq for FunctionType
impl PartialEq for FunctionType
Source§impl PrettyPrint for FunctionType
impl PrettyPrint for FunctionType
Source§fn to_pretty_string(&self) -> String
fn to_pretty_string(&self) -> String
Source§fn pretty_print(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn pretty_print(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Pretty-print this object to the given core::fmt::Formatter. Read more
Source§impl Serialize for FunctionType
impl Serialize for FunctionType
impl Eq for FunctionType
impl StructuralPartialEq for FunctionType
Auto Trait Implementations§
impl Freeze for FunctionType
impl RefUnwindSafe for FunctionType
impl Send for FunctionType
impl Sync for FunctionType
impl Unpin for FunctionType
impl UnwindSafe for FunctionType
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