pub struct SolidityBackend {
pub contracts: Vec<SolidityContract>,
pub ctx: CompilationCtx,
pub type_aliases: HashMap<String, SolidityType>,
pub source: String,
}Expand description
The main Solidity code generation backend.
Fields§
§contracts: Vec<SolidityContract>Emitted contracts (in order).
ctx: CompilationCtxCompilation context.
type_aliases: HashMap<String, SolidityType>Type alias table: alias → canonical SolidityType.
source: StringSource buffer accumulated during emission.
Implementations§
Source§impl SolidityBackend
impl SolidityBackend
pub fn new() -> Self
pub fn with_runtime(self) -> Self
pub fn add_contract(&mut self, contract: SolidityContract)
pub fn add_pragma(&mut self, pragma: impl Into<String>)
pub fn add_import(&mut self, import: impl Into<String>)
Sourcepub fn compile_decl(&mut self, name: &str, ty: SolidityType) -> SolidityStateVar
pub fn compile_decl(&mut self, name: &str, ty: SolidityType) -> SolidityStateVar
Compile a single LCNF-style declaration (simplified: name → state var).
Sourcepub fn emit_contract(&mut self) -> String
pub fn emit_contract(&mut self) -> String
Emit the full Solidity source for all registered contracts.
Trait Implementations§
Source§impl Debug for SolidityBackend
impl Debug for SolidityBackend
Source§impl Default for SolidityBackend
impl Default for SolidityBackend
Source§fn default() -> SolidityBackend
fn default() -> SolidityBackend
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SolidityBackend
impl RefUnwindSafe for SolidityBackend
impl Send for SolidityBackend
impl Sync for SolidityBackend
impl Unpin for SolidityBackend
impl UnsafeUnpin for SolidityBackend
impl UnwindSafe for SolidityBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more