Solc

Struct Solc 

Source
pub struct Solc(/* private fields */);
Expand description

The solc struct. It is a wrapper around the solc compiler.

Implementations§

Source§

impl Solc

Source

pub fn new() -> Solc

Create a new solc wrapper.

§Arguments
  • binary - The binary to use. eg. solc.
§Returns
  • Solc - The solc wrapper.
§TODO
  • Add error handling.
  • Add support for other compilers. eg solcjs.
Source

pub fn parse_version(version: &str) -> String

Parse version number.

§Arguments
  • version - The version string.
§Returns
  • String - The version number.
Source

pub fn version(&self) -> String

Get the solc version.

§Returns
  • String - The solc version.
Source

pub fn compile( &self, input_path: &str, out_path: &str, opts: Vec<&str>, ) -> Result<String, String>

Compile solidity code.

§Arguments
  • input_path - The path to the solidity file.
  • out_path - The path to the output file.
  • opts - Optional arguments.
§Returns
  • Ok(String) - The compiled contract.
  • Err(String) - The error message.

Auto Trait Implementations§

§

impl Freeze for Solc

§

impl RefUnwindSafe for Solc

§

impl Send for Solc

§

impl Sync for Solc

§

impl Unpin for Solc

§

impl UnwindSafe for Solc

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.