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>
pub fn write_to_file<P>(&self, path: P) -> Result<(), Error>
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 Freeze for ContractBindings
impl RefUnwindSafe for ContractBindings
impl !Send for ContractBindings
impl !Sync for ContractBindings
impl Unpin for ContractBindings
impl UnwindSafe for ContractBindings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, U> FlattenInto<U> for Twhere
U: FlattenFrom<T>,
impl<T, U> FlattenInto<U> for Twhere
U: FlattenFrom<T>,
fn flatten_into(self) -> U
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more