pub struct VyperBackend {
pub contract: Option<VyperContract>,
pub ctx: VyperCompilationCtx,
pub type_aliases: HashMap<String, VyperType>,
pub source: String,
}Expand description
The main Vyper code generation backend.
Fields§
§contract: Option<VyperContract>Emitted contract (only one per Vyper file).
ctx: VyperCompilationCtxCompilation context.
type_aliases: HashMap<String, VyperType>Type alias table.
source: StringSource buffer accumulated during emission.
Implementations§
Source§impl VyperBackend
impl VyperBackend
pub fn new() -> Self
pub fn with_runtime(self) -> Self
pub fn with_version(self, version: impl Into<String>) -> Self
pub fn set_contract(&mut self, contract: VyperContract)
Sourcepub fn compile_decl(&self, name: &str, ty: VyperType) -> VyperStorageVar
pub fn compile_decl(&self, name: &str, ty: VyperType) -> VyperStorageVar
Compile a single LCNF-style declaration into a Vyper storage variable.
Sourcepub fn emit_contract(&mut self) -> String
pub fn emit_contract(&mut self) -> String
Emit the full Vyper source for the registered contract.
Trait Implementations§
Source§impl Debug for VyperBackend
impl Debug for VyperBackend
Source§impl Default for VyperBackend
impl Default for VyperBackend
Source§fn default() -> VyperBackend
fn default() -> VyperBackend
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for VyperBackend
impl RefUnwindSafe for VyperBackend
impl Send for VyperBackend
impl Sync for VyperBackend
impl Unpin for VyperBackend
impl UnsafeUnpin for VyperBackend
impl UnwindSafe for VyperBackend
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