Struct fuels_core::code_gen::bindings::ContractBindings
source · pub struct ContractBindings {
pub tokens: TokenStream,
pub rustfmt: bool,
}
Expand description
Type-safe contract bindings generated by a Builder
. This type can be
either written to file or into a token stream for use in a procedural macro.
Fields§
§tokens: TokenStream
The TokenStream representing the contract bindings.
rustfmt: bool
The output options used for serialization.
Implementations§
source§impl ContractBindings
impl ContractBindings
sourcepub fn write<W>(&self, w: W) -> Result<(), Error>where
W: Write,
pub fn write<W>(&self, w: W) -> Result<(), Error>where
W: Write,
Writes the bindings to a given Write
.
sourcepub fn write_to_file<P>(&self, path: P) -> Result<(), Error>where
P: AsRef<Path>,
pub fn write_to_file<P>(&self, path: P) -> Result<(), Error>where
P: AsRef<Path>,
Writes the bindings to the specified file.
sourcepub fn into_tokens(self) -> TokenStream
pub fn into_tokens(self) -> TokenStream
Converts the bindings into its underlying token stream. This allows it to be used within a procedural macro.