pub enum SourceCodeMetadata {
Sources(HashMap<String, SourceCodeEntry>),
Metadata {
language: Option<SourceCodeLanguage>,
sources: HashMap<String, SourceCodeEntry>,
settings: Option<Value>,
},
SourceCode(String),
}
Expand description
The contract metadata’s SourceCode field.
Variants§
Sources(HashMap<String, SourceCodeEntry>)
Contains just mapped source code.
Metadata
Fields
§
language: Option<SourceCodeLanguage>
Programming language of the sources.
§
sources: HashMap<String, SourceCodeEntry>
Source path => source code
Contains metadata and path mapped source code.
SourceCode(String)
Contains only the source code.
Implementations§
source§impl SourceCodeMetadata
impl SourceCodeMetadata
pub fn source_code(&self) -> String
pub fn language(&self) -> Option<SourceCodeLanguage>
pub fn sources(&self) -> HashMap<String, SourceCodeEntry>
pub fn settings(&self) -> Result<Option<Settings>, EtherscanError>
Available on crate feature
ethers-solc
only.Trait Implementations§
source§impl Clone for SourceCodeMetadata
impl Clone for SourceCodeMetadata
source§fn clone(&self) -> SourceCodeMetadata
fn clone(&self) -> SourceCodeMetadata
Returns a copy 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 SourceCodeMetadata
impl Debug for SourceCodeMetadata
source§impl<'de> Deserialize<'de> for SourceCodeMetadata
impl<'de> Deserialize<'de> for SourceCodeMetadata
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 RefUnwindSafe for SourceCodeMetadata
impl Send for SourceCodeMetadata
impl Sync for SourceCodeMetadata
impl Unpin for SourceCodeMetadata
impl UnwindSafe for SourceCodeMetadata
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