1use super::TypeCollector;2use core::fmt;34pub trait StructCollect: 'static {5 6 fn name() -> String;7 8 fn declaration() -> String;9}1011pub trait SolidityTypeName: 'static {12 fn solidity_name(writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;13 14 fn is_simple() -> bool;15 fn solidity_default(writer: &mut impl fmt::Write, tc: &TypeCollector) -> fmt::Result;16 17 fn is_void() -> bool {18 false19 }20}2122pub trait SolidityType {23 fn names(tc: &TypeCollector) -> Vec<String>;24 fn len() -> usize;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}