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 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 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 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 moreSource§impl Debug for SolcCompilerIoReporter
impl Debug for SolcCompilerIoReporter
Source§impl Default for SolcCompilerIoReporter
impl Default for SolcCompilerIoReporter
Source§fn default() -> SolcCompilerIoReporter
fn default() -> SolcCompilerIoReporter
Auto Trait Implementations§
impl Freeze for SolcCompilerIoReporter
impl RefUnwindSafe for SolcCompilerIoReporter
impl Send for SolcCompilerIoReporter
impl Sync for SolcCompilerIoReporter
impl Unpin for SolcCompilerIoReporter
impl UnwindSafe for SolcCompilerIoReporter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more