Struct fuels_core::code_gen::abigen::Abigen
source · pub struct Abigen { /* private fields */ }
Implementations
sourceimpl Abigen
impl Abigen
sourcepub fn new<S: AsRef<str>>(
contract_name: &str,
abi_source: S
) -> Result<Self, Error>
pub fn new<S: AsRef<str>>(
contract_name: &str,
abi_source: S
) -> Result<Self, Error>
Creates a new contract with the given ABI JSON source.
pub fn no_std(self) -> Self
sourcepub fn generate(self) -> Result<ContractBindings, Error>
pub fn generate(self) -> Result<ContractBindings, Error>
Generates the contract bindings.
sourcepub fn expand(&self) -> Result<TokenStream, Error>
pub fn expand(&self) -> Result<TokenStream, Error>
Entry point of the Abigen’s expansion logic. The high-level goal of this function is to expand* a contract defined as a JSON into type-safe bindings of that contract that can be used after it is brought into scope after a successful generation.
*: To expand, in procedural macro terms, means to automatically generate
Rust code after a transformation of TokenStream
to another
set of TokenStream
. This generated Rust code is the brought into scope
after it is called through a procedural macro (abigen!()
in our case).
pub fn functions(&self) -> Result<TokenStream, Error>
pub fn should_skip_codegen(type_field: &str) -> Result<bool>
sourcepub fn get_types(abi: &ProgramABI) -> HashMap<usize, TypeDeclaration>
pub fn get_types(abi: &ProgramABI) -> HashMap<usize, TypeDeclaration>
Reads the parsed ABI and returns all the types in it.
Auto Trait Implementations
impl RefUnwindSafe for Abigen
impl !Send for Abigen
impl !Sync for Abigen
impl Unpin for Abigen
impl UnwindSafe for Abigen
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more