Skip to main content

oxilean_codegen/ffi_bridge/
ffifuncsignature_traits.rs

1//! # FfiFuncSignature - Trait Implementations
2//!
3//! This module contains trait implementations for `FfiFuncSignature`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Display`
8//!
9//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
10
11use crate::lcnf::*;
12
13use super::types::FfiFuncSignature;
14use std::fmt;
15
16impl std::fmt::Display for FfiFuncSignature {
17    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18        let params: Vec<String> = self.params.iter().map(|p| p.to_string()).collect();
19        let noexcept = if self.is_noexcept { " noexcept" } else { "" };
20        write!(
21            f,
22            "{} {}{}({}){}",
23            self.ret_type,
24            self.calling_conv,
25            self.name,
26            params.join(", "),
27            noexcept
28        )
29    }
30}