1use super::TypeCollector;2use core::fmt;34pub trait SolidityTypeName: 'static {5 fn solidity_name(writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;6 7 fn is_simple() -> bool;8 fn solidity_default(writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;9 10 fn is_void() -> bool {11 false12 }13}1415pub trait SolidityTupleTy: 'static {16 fn fields(tc: &TypeCollector) -> Vec<String>;17 fn len() -> usize;18}19pub trait SolidityStructTy: 'static {20 fn generate_solidity_interface(tc: &TypeCollector) -> String;21}22pub trait SolidityEnumTy: 'static {23 fn generate_solidity_interface(tc: &TypeCollector) -> String;24 fn solidity_option(&self) -> &str;25}2627pub trait SolidityArguments {28 fn solidity_name(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;29 fn solidity_get(&self, prefix: &str, writer: &mut impl fmt::Write) -> fmt::Result;30 fn solidity_default(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;31 fn is_empty(&self) -> bool {32 self.len() == 033 }34 fn len(&self) -> usize;35}3637pub trait SolidityFunctions {38 fn solidity_name(39 &self,40 is_impl: bool,41 writer: &mut impl fmt::Write,42 tc: &TypeCollector,43 ) -> fmt::Result;44}4546pub trait SolidityItems {47 fn solidity_name(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;48 49 50}