Struct ethers_solc::report::SolcCompilerIoReporter
source · pub struct SolcCompilerIoReporter { /* private fields */ }
Expand description
Debug Helper type that can be used to write the crate::Solc CompilerInput and CompilerOutput to disk if configured.
§Example
If ETHERS_SOLC_LOG=in=in.json,out=out.json
is then the reporter will be configured to write
the compiler input as pretty formatted json to in.{solc version}.json
and the compiler output
to out.{solc version}.json
use ethers_solc::report::SolcCompilerIoReporter;
std::env::set_var("ETHERS_SOLC_LOG", "in=in.json,out=out.json");
let rep = SolcCompilerIoReporter::from_default_env();
Implementations§
source§impl SolcCompilerIoReporter
impl SolcCompilerIoReporter
sourcepub fn new(value: impl AsRef<str>) -> Self
pub fn new(value: impl AsRef<str>) -> Self
Returns a new SolcCompilerIOLayer
from the fields in the given string,
ignoring any that are invalid.
sourcepub const DEFAULT_ENV: &'static str = "ETHERS_SOLC_LOG"
pub const DEFAULT_ENV: &'static str = "ETHERS_SOLC_LOG"
ETHERS_SOLC_LOG
is the default environment variable used by
SolcCompilerIOLayer::from_default_env
sourcepub fn from_default_env() -> Self
pub fn from_default_env() -> Self
Returns a new SolcCompilerIOLayer
from the value of the ETHERS_SOLC_LOG
environment
variable, ignoring any invalid filter directives.
sourcepub fn from_env<A: AsRef<str>>(env: A) -> Self
pub fn from_env<A: AsRef<str>>(env: A) -> Self
Returns a new SolcCompilerIOLayer
from the value of the given environment
variable, ignoring any invalid filter directives.
sourcepub fn log_compiler_input(&self, input: &CompilerInput, version: &Version)
pub fn log_compiler_input(&self, input: &CompilerInput, version: &Version)
Callback to write the input to disk if target is set
sourcepub fn log_compiler_output(&self, output: &CompilerOutput, version: &Version)
pub fn log_compiler_output(&self, output: &CompilerOutput, version: &Version)
Callback to write the input to disk if target is set
Trait Implementations§
source§impl Clone for SolcCompilerIoReporter
impl Clone for SolcCompilerIoReporter
source§fn clone(&self) -> SolcCompilerIoReporter
fn clone(&self) -> SolcCompilerIoReporter
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more