1use super::TypeCollector;2use core::fmt;34pub trait StructCollect: 'static {5 6 fn name() -> String;7 8 fn declaration() -> String;9}1011pub trait SolidityEnum: 'static {12 fn solidity_option(&self) -> &str;13}1415pub trait SolidityTypeName: 'static {16 fn solidity_name(writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;17 18 fn is_simple() -> bool;19 fn solidity_default(writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;20 21 fn is_void() -> bool {22 false23 }24}2526pub trait SolidityType {27 fn names(tc: &TypeCollector) -> Vec<String>;28 fn len() -> usize;29}3031pub trait SolidityArguments {32 fn solidity_name(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;33 fn solidity_get(&self, prefix: &str, writer: &mut impl fmt::Write) -> fmt::Result;34 fn solidity_default(&self, writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;35 fn is_empty(&self) -> bool {36 self.len() == 037 }38 fn len(&self) -> usize;39}4041pub trait SolidityFunctions {42 fn solidity_name(43 &self,44 is_impl: bool,45 writer: &mut impl fmt::Write,46 tc: &TypeCollector,47 ) -> fmt::Result;48}