Struct ethers_solc::artifacts::Source
source · pub struct Source {
pub content: String,
}Fields
content: StringImplementations
sourceimpl Source
impl Source
sourcepub fn read_all_from(dir: impl AsRef<Path>) -> Result<Sources, SolcIoError>
pub fn read_all_from(dir: impl AsRef<Path>) -> Result<Sources, SolcIoError>
Recursively finds all source files under the given dir path and reads them all
sourcepub fn read_all_files(files: Vec<PathBuf>) -> Result<Sources, SolcIoError>
pub fn read_all_files(files: Vec<PathBuf>) -> Result<Sources, SolcIoError>
Reads all source files of the given vec
Depending on the len of the vec it will try to read the files in parallel
sourcepub fn read_all<T, I>(files: I) -> Result<Sources, SolcIoError>where
I: IntoIterator<Item = T>,
T: Into<PathBuf>,
pub fn read_all<T, I>(files: I) -> Result<Sources, SolcIoError>where
I: IntoIterator<Item = T>,
T: Into<PathBuf>,
Reads all files
sourcepub fn par_read_all<T, I>(files: I) -> Result<Sources, SolcIoError>where
I: IntoIterator<Item = T>,
<I as IntoIterator>::IntoIter: Send,
T: Into<PathBuf> + Send,
pub fn par_read_all<T, I>(files: I) -> Result<Sources, SolcIoError>where
I: IntoIterator<Item = T>,
<I as IntoIterator>::IntoIter: Send,
T: Into<PathBuf> + Send,
Parallelized version of Self::read_all that reads all files using a parallel iterator
NOTE: this is only expected to be faster than Self::read_all if the given iterator
contains at least several paths or the files are rather large.
sourcepub fn content_hash(&self) -> String
pub fn content_hash(&self) -> String
Generate a non-cryptographically secure checksum of the file’s content
sourcepub fn parse_imports(&self) -> Vec<&str> ⓘ
pub fn parse_imports(&self) -> Vec<&str> ⓘ
Returns all import statements of the file
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Source
impl<'de> Deserialize<'de> for Source
sourcefn 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
impl Eq for Source
impl StructuralEq for Source
impl StructuralPartialEq for Source
Auto Trait Implementations
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnwindSafe for Source
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.