pub struct SourceTypes { /* private fields */ }Expand description
The struct, enum, and user-defined value type declarations of a set of sources.
Implementations§
Source§impl SourceTypes
impl SourceTypes
Sourcepub fn add_source(&mut self, source_id: u64, source: &str)
pub fn add_source(&mut self, source_id: u64, source: &str)
Adds the declarations of another source.
Sourcepub fn scope_at(&self, source_id: u64, offset: u64) -> Option<&str>
pub fn scope_at(&self, source_id: u64, offset: u64) -> Option<&str>
The contract, library, or interface whose block contains offset of the source,
innermost first: the scope a name written there resolves in.
Sourcepub fn struct_members(
&self,
scope: Option<&str>,
name: &str,
) -> Option<&[StructMember]>
pub fn struct_members( &self, scope: Option<&str>, name: &str, ) -> Option<&[StructMember]>
The members of the struct name names, as written in scope (a contract name,
or None for file level); name may be qualified as Contract.Name.
Sourcepub fn enum_variants(
&self,
scope: Option<&str>,
name: &str,
) -> Option<&[String]>
pub fn enum_variants( &self, scope: Option<&str>, name: &str, ) -> Option<&[String]>
The variants of the enum name names, in declaration order.
Sourcepub fn underlying(&self, scope: Option<&str>, name: &str) -> Option<&str>
pub fn underlying(&self, scope: Option<&str>, name: &str) -> Option<&str>
The type a user-defined value type wraps.
Sourcepub fn enum_literal(&self, scope: Option<&str>, path: &str) -> Option<u64>
pub fn enum_literal(&self, scope: Option<&str>, path: &str) -> Option<u64>
The value of an enum literal such as Color.Red or Shop.Color.Red.
Sourcepub fn is_struct(&self, scope: Option<&str>, name: &str) -> bool
pub fn is_struct(&self, scope: Option<&str>, name: &str) -> bool
Whether name is a struct, however qualified.
Sourcepub fn enum_variants_by_name(&self) -> BTreeMap<String, Vec<String>>
pub fn enum_variants_by_name(&self) -> BTreeMap<String, Vec<String>>
Every enum’s variants, keyed the way a storage layout labels the type
(Shop.Color) and by its bare name (Color), for
soldb_ethdebug::StorageLayout::enum_variants. A bare name declared twice keeps
its first declaration.
Trait Implementations§
Source§impl Clone for SourceTypes
impl Clone for SourceTypes
Source§fn clone(&self) -> SourceTypes
fn clone(&self) -> SourceTypes
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more