pub struct Source {
pub content: Option<String>,
pub urls: Option<Vec<String>>,
pub keccak256: Option<String>,
}Expand description
The solc --standard-json input source.
Fields§
§content: Option<String>The source code file content.
urls: Option<Vec<String>>The source file URLs.
keccak256: Option<String>The expected source code hash.
Implementations§
Source§impl Source
impl Source
Sourcepub fn try_read(path: &Path) -> Result<Self>
pub fn try_read(path: &Path) -> Result<Self>
Reads the source from the file system, or from the standard input if path is STDIN_PATH.
The standard input is consumed on the first read and the same content is returned afterwards.
Sourcepub fn try_resolve(&mut self) -> Result<()>
pub fn try_resolve(&mut self) -> Result<()>
Tries to resolve the source code.
At the moment only one URL pointing to the file system is supported.
Sourcepub fn take_content(&mut self) -> Option<String>
pub fn take_content(&mut self) -> Option<String>
Takes ownership of the source code and returns it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Source
impl<'de> Deserialize<'de> for Source
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 Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnsafeUnpin for Source
impl UnwindSafe for Source
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