pub struct Signature {
pub name: String,
pub params: Vec<Parameter>,
pub ret_ty: Option<MirType>,
pub ret_signedness: Signedness,
pub ret_aggregate: Option<Aggregate>,
pub kernel: Option<KernelMetadata>,
pub no_inline: bool,
}Expand description
Function signature
Fields§
§name: StringFunction name
params: Vec<Parameter>Parameters (in order)
ret_ty: Option<MirType>Return type (None for void)
ret_signedness: SignednessSignedness of an integer return value
ret_aggregate: Option<Aggregate>Set when the function returns an aggregate by value. ret_ty is then the pointer
to it, and a call’s result register names the caller’s slot for the copy.
kernel: Option<KernelMetadata>§no_inline: boolSet by @noinline; the inliner must leave calls to this function alone.
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Creates a void, parameterless, non-kernel signature that the inliner may inline.
Sourcepub fn with_kernel(self, metadata: KernelMetadata) -> Self
pub fn with_kernel(self, metadata: KernelMetadata) -> Self
Marks the function as a GPU kernel, which GPU codegen requires to be void with a single block.
pub fn with_params(self, params: Vec<Parameter>) -> Self
pub fn with_return(self, ty: MirType) -> Self
pub fn with_return_signedness(self, signedness: Signedness) -> Self
pub fn with_return_aggregate(self, aggregate: Aggregate) -> Self
pub fn param_count(&self) -> usize
Trait Implementations§
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