pub struct Contract {
pub name: &'static str,
pub imports: &'static [Import],
pub functions: &'static [Function],
pub events: &'static [Event],
}Expand description
Complete schema for a contract.
Fields§
§name: &'static strContract name.
imports: &'static [Import]List of imported types with their full paths.
functions: &'static [Function]List of contract functions.
events: &'static [Event]List of contract events.
Implementations§
Source§impl Contract
impl Contract
Sourcepub fn iter_imports(&self) -> impl Iterator<Item = &Import>
pub fn iter_imports(&self) -> impl Iterator<Item = &Import>
Returns an iterator over all imports.
Sourcepub fn iter_functions(&self) -> impl Iterator<Item = &Function>
pub fn iter_functions(&self) -> impl Iterator<Item = &Function>
Returns an iterator over all functions.
Sourcepub fn iter_events(&self) -> impl Iterator<Item = &Event>
pub fn iter_events(&self) -> impl Iterator<Item = &Event>
Returns an iterator over all events.
Sourcepub fn get_import(&self, name: &str) -> Option<&Import>
pub fn get_import(&self, name: &str) -> Option<&Import>
Find an import by short name.
Sourcepub fn get_function(&self, name: &str) -> Option<&Function>
pub fn get_function(&self, name: &str) -> Option<&Function>
Find a function by name.
Trait Implementations§
impl Copy 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 UnsafeUnpin 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