Struct ethers::solc::cache::SolFilesCache [−][src]
pub struct SolFilesCache {
pub format: String,
pub files: BTreeMap<PathBuf, CacheEntry>,
}
Expand description
A hardhat compatible cache representation
Fields
format: String
files: BTreeMap<PathBuf, CacheEntry>
Implementations
Example
Autodetect solc version and default settings
use ethers_solc::artifacts::Source;
use ethers_solc::cache::SolFilesCache;
let files = Source::read_all_from("./sources").unwrap();
let config = SolFilesCache::builder().insert_files(files, None).unwrap();
Reads the cache json file from the given path
Write the cache to json file
pub fn get_changed_files(
&'a self,
sources: BTreeMap<PathBuf, Source>,
config: Option<&'a SolcConfig>
) -> BTreeMap<PathBuf, Source>
pub fn get_changed_files(
&'a self,
sources: BTreeMap<PathBuf, Source>,
config: Option<&'a SolcConfig>
) -> BTreeMap<PathBuf, Source>
Returns only the files that were changed from the provided sources, to save time when compiling.
Returns true if the given content hash or config differs from the file’s or the file does not exist
pub fn get_changed_or_missing_artifacts_files<T>(
&'a self,
sources: BTreeMap<PathBuf, Source>,
config: Option<&'a SolcConfig>,
artifacts_root: &Path
) -> BTreeMap<PathBuf, Source> where
T: ArtifactOutput,
pub fn get_changed_or_missing_artifacts_files<T>(
&'a self,
sources: BTreeMap<PathBuf, Source>,
config: Option<&'a SolcConfig>,
artifacts_root: &Path
) -> BTreeMap<PathBuf, Source> where
T: ArtifactOutput,
Returns only the files that were changed or are missing artifacts compared to previous compiler execution, to save time when compiling.
pub fn has_changed_or_missing_artifact<T>(
&self,
file: &Path,
hash: &[u8],
config: Option<&SolcConfig>,
artifacts_root: &Path
) -> bool where
T: ArtifactOutput,
pub fn has_changed_or_missing_artifact<T>(
&self,
file: &Path,
hash: &[u8],
config: Option<&SolcConfig>,
artifacts_root: &Path
) -> bool where
T: ArtifactOutput,
Returns true if the given content hash or config differs from the file’s or the file does not exist or the files’ artifacts are missing
Checks if all artifact files exist
pub fn read_artifacts<T>(
&self,
artifacts_root: &Path
) -> Result<BTreeMap<PathBuf, <T as ArtifactOutput>::Artifact>, SolcError> where
T: ArtifactOutput,
pub fn read_artifacts<T>(
&self,
artifacts_root: &Path
) -> Result<BTreeMap<PathBuf, <T as ArtifactOutput>::Artifact>, SolcError> where
T: ArtifactOutput,
Reads all cached artifacts from disk
Trait Implementations
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<SolFilesCache, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<SolFilesCache, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for SolFilesCache
impl Send for SolFilesCache
impl Sync for SolFilesCache
impl Unpin for SolFilesCache
impl UnwindSafe for SolFilesCache
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more