Struct ethers_solc::artifacts::CompilerInput
source · [−]Expand description
Input type solc expects
Fields
language: Stringsources: Sourcessettings: SettingsImplementations
sourceimpl CompilerInput
impl CompilerInput
sourcepub fn new(path: impl AsRef<Path>) -> Result<Vec<Self>, SolcIoError>
pub fn new(path: impl AsRef<Path>) -> Result<Vec<Self>, SolcIoError>
Reads all contracts found under the path
sourcepub fn with_sources(sources: Sources) -> Vec<Self>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn with_sources(sources: Sources) -> Vec<Self>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Creates a new CompilerInputs with default settings and the given sources
A CompilerInput expects a language setting, supported by solc are solidity or yul.
In case the sources is a mix of solidity and yul files, 2 CompilerInputs are returned
sourcepub fn sanitized(self, version: &Version) -> Self
pub fn sanitized(self, version: &Version) -> Self
This will remove/adjust values in the CompilerInput that are not compatible with this
version
sourcepub fn evm_version(self, version: EvmVersion) -> Self
pub fn evm_version(self, version: EvmVersion) -> Self
Sets the EVM version for compilation
sourcepub fn normalize_evm_version(self, version: &Version) -> Self
pub fn normalize_evm_version(self, version: &Version) -> Self
Normalizes the EVM version used in the settings to be up to the latest one supported by the provided compiler version.
pub fn with_remappings(self, remappings: Vec<Remapping>) -> Self
sourcepub fn join_path(self, root: impl AsRef<Path>) -> Self
pub fn join_path(self, root: impl AsRef<Path>) -> Self
Sets the path of the source files to root adjoined to the existing path
sourcepub fn strip_prefix(self, base: impl AsRef<Path>) -> Self
pub fn strip_prefix(self, base: impl AsRef<Path>) -> Self
Removes the base path from all source files
sourcepub fn with_base_path(self, base: impl AsRef<Path>) -> Self
pub fn with_base_path(self, base: impl AsRef<Path>) -> Self
Similar to Self::strip_prefix(). Remove a base path from all
sources and all paths in solc settings such as remappings
See also solc --base-path
Trait Implementations
sourceimpl Clone for CompilerInput
impl Clone for CompilerInput
sourcefn clone(&self) -> CompilerInput
fn clone(&self) -> CompilerInput
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for CompilerInput
impl Debug for CompilerInput
sourceimpl<'de> Deserialize<'de> for CompilerInput
impl<'de> Deserialize<'de> for CompilerInput
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
sourceimpl From<CompilerInput> for StandardJsonCompilerInput
impl From<CompilerInput> for StandardJsonCompilerInput
sourcefn from(input: CompilerInput) -> Self
fn from(input: CompilerInput) -> Self
Converts to this type from the input type.
sourceimpl From<StandardJsonCompilerInput> for CompilerInput
impl From<StandardJsonCompilerInput> for CompilerInput
sourcefn from(input: StandardJsonCompilerInput) -> Self
fn from(input: StandardJsonCompilerInput) -> Self
Converts to this type from the input type.
sourceimpl Serialize for CompilerInput
impl Serialize for CompilerInput
Auto Trait Implementations
impl RefUnwindSafe for CompilerInput
impl Send for CompilerInput
impl Sync for CompilerInput
impl Unpin for CompilerInput
impl UnwindSafe for CompilerInput
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more