Skip to main content

oxilean_codegen/evm_backend/
evmabievent_traits.rs

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