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
sourceimpl 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.
Auto Trait Implementations
impl RefUnwindSafe for ContractBindings
impl !Send for ContractBindings
impl !Sync for ContractBindings
impl Unpin for ContractBindings
impl UnwindSafe for ContractBindings
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