1use super::TypeCollector;2use core::fmt;34pub mod sealed {5 6 7 8 9 pub trait CanBePlacedInVec {}10}1112pub trait StructCollect: 'static {13 14 fn name() -> String;15 16 fn declaration() -> String;17}1819pub trait SolidityTypeName: 'static {20 fn solidity_name(writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;21 22 fn is_simple() -> bool;23 fn solidity_default(writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;24 25 fn is_void() -> bool {26 false27 }28}2930pub trait SolidityTupleType {31 fn names(tc: &TypeCollector) -> Vec<String>;32 fn len() -> usize;33}3435pub trait SolidityArguments {36 fn solidity_name(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;37 fn solidity_get(&self, prefix: &str, writer: &mut impl fmt::Write) -> fmt::Result;38 fn solidity_default(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;39 fn is_empty(&self) -> bool {40 self.len() == 041 }42 fn len(&self) -> usize;43}4445pub trait SolidityFunctions {46 fn solidity_name(47 &self,48 is_impl: bool,49 writer: &mut impl fmt::Write,50 tc: &TypeCollector,51 ) -> fmt::Result;52}