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>
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 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