pub struct Contract { /* private fields */ }
Expand description
An contract definition consisting of the configuration and module.
Implementations§
Source§impl Contract
impl Contract
Sourcepub fn new(_config: TokenStream2, module: TokenStream2) -> Result<Self, Error>
pub fn new(_config: TokenStream2, module: TokenStream2) -> Result<Self, Error>
Creates a new contract from the given configuration and module
Sourcepub fn vis(&self) -> &Visibility
pub fn vis(&self) -> &Visibility
Returns the visibility of the chain module.
pub fn has_main_struct(&self) -> bool
pub fn has_sub_struct(&self) -> bool
pub fn has_apply_func(&self) -> bool
pub fn has_trait(&self, s: &str, trait_: &str) -> bool
pub fn has_primary_value_interface_trait(&self, s: &str) -> bool
pub fn has_secondary_value_interface_trait(&self, s: &str) -> bool
pub fn analyze_items(&mut self) -> Result<(), Error>
pub fn get_type_name(field: &Field) -> Result<String, Error>
pub fn add_packer(&mut self, name: &str) -> Result<(), Error>
pub fn generate_code(&self) -> Result<TokenStream2, Error>
pub fn get_items(self) -> Vec<Item>
pub fn is_action_impl_block(item_impl: &ItemImpl) -> Result<bool, Error>
Trait Implementations§
impl Eq for Contract
impl StructuralPartialEq for Contract
Auto Trait Implementations§
impl Freeze for Contract
impl RefUnwindSafe for Contract
impl !Send for Contract
impl !Sync for Contract
impl Unpin for Contract
impl UnwindSafe for Contract
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> 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