Struct foundry_compilers::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.
§Examples
If foundry_compilers_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 foundry_compilers::report::SolcCompilerIoReporter;
std::env::set_var("foundry_compilers_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 = "foundry_compilers_LOG"
pub const DEFAULT_ENV: &'static str = "foundry_compilers_LOG"
foundry_compilers_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 foundry_compilers_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> 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