Struct fuels_core::code_gen::flat_abigen::FlatAbigen
source · [−]pub struct FlatAbigen { /* private fields */ }Implementations
sourceimpl FlatAbigen
impl FlatAbigen
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>
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 FlatAbigen
impl !Send for FlatAbigen
impl !Sync for FlatAbigen
impl Unpin for FlatAbigen
impl UnwindSafe for FlatAbigen
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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