pub struct ProgramModel {
pub name: String,
pub state_vars: BTreeMap<String, StateVar>,
pub functions: BTreeMap<String, FunctionModel>,
pub mutation_graph: BTreeMap<String, BTreeSet<String>>,
pub chain: String,
pub source_path: String,
}Expand description
A complete program model extracted from source code.
Fields§
§name: StringProgram/contract/module name.
state_vars: BTreeMap<String, StateVar>State variables.
functions: BTreeMap<String, FunctionModel>Functions/entry points.
mutation_graph: BTreeMap<String, BTreeSet<String>>Functions → Mutations mapping (deterministic).
chain: StringChains supported: “solana”, “evm”, “move”.
source_path: StringSource file path.
Implementations§
Source§impl ProgramModel
impl ProgramModel
Sourcepub fn new(name: String, chain: String, source_path: String) -> Self
pub fn new(name: String, chain: String, source_path: String) -> Self
Create a new program model.
Sourcepub fn add_state_var(&mut self, var: StateVar)
pub fn add_state_var(&mut self, var: StateVar)
Add a state variable to the model.
Sourcepub fn add_function(&mut self, func: FunctionModel)
pub fn add_function(&mut self, func: FunctionModel)
Add a function to the model.
Trait Implementations§
Source§impl Clone for ProgramModel
impl Clone for ProgramModel
Source§fn clone(&self) -> ProgramModel
fn clone(&self) -> ProgramModel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProgramModel
impl Debug for ProgramModel
Source§impl<'de> Deserialize<'de> for ProgramModel
impl<'de> Deserialize<'de> for ProgramModel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ProgramModel
impl RefUnwindSafe for ProgramModel
impl Send for ProgramModel
impl Sync for ProgramModel
impl Unpin for ProgramModel
impl UnsafeUnpin for ProgramModel
impl UnwindSafe for ProgramModel
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