Struct ethcontract_common::artifact::truffle::TruffleLoader
source · [−]Expand description
Loads truffle artifacts.
Fields
origin: Option<String>Override for artifact’s origin.
If empty, origin will be derived automatically.
name: Option<String>Override for contract’s name.
Truffle artifacts contain a single contract which may be unnamed.
Implementations
sourceimpl TruffleLoader
impl TruffleLoader
sourcepub fn with_origin(origin: impl Into<String>) -> Self
pub fn with_origin(origin: impl Into<String>) -> Self
Creates a new truffle loader and sets an override for artifact’s origins.
sourcepub fn origin(self, origin: impl Into<String>) -> Self
pub fn origin(self, origin: impl Into<String>) -> Self
Sets new override for artifact’s origin. See origin for more info.
sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Sets new override for artifact’s name. See name for more info.
sourcepub fn load_from_reader(&self, v: impl Read) -> Result<Artifact, ArtifactError>
pub fn load_from_reader(&self, v: impl Read) -> Result<Artifact, ArtifactError>
Loads an artifact from a loaded JSON value.
sourcepub fn load_from_slice(&self, v: &[u8]) -> Result<Artifact, ArtifactError>
pub fn load_from_slice(&self, v: &[u8]) -> Result<Artifact, ArtifactError>
Loads an artifact from bytes of JSON text.
sourcepub fn load_from_str(&self, v: &str) -> Result<Artifact, ArtifactError>
pub fn load_from_str(&self, v: &str) -> Result<Artifact, ArtifactError>
Loads an artifact from string of JSON text.
sourcepub fn load_from_value(&self, v: Value) -> Result<Artifact, ArtifactError>
pub fn load_from_value(&self, v: Value) -> Result<Artifact, ArtifactError>
Loads an artifact from a loaded JSON value.
sourcepub fn load_from_file(
&self,
p: impl AsRef<Path>
) -> Result<Artifact, ArtifactError>
pub fn load_from_file(
&self,
p: impl AsRef<Path>
) -> Result<Artifact, ArtifactError>
Loads an artifact from disk.
sourcepub fn load_contract_from_reader(
&self,
v: impl Read
) -> Result<Contract, ArtifactError>
pub fn load_contract_from_reader(
&self,
v: impl Read
) -> Result<Contract, ArtifactError>
Loads a contract from a loaded JSON value.
sourcepub fn load_contract_from_slice(
&self,
v: &[u8]
) -> Result<Contract, ArtifactError>
pub fn load_contract_from_slice(
&self,
v: &[u8]
) -> Result<Contract, ArtifactError>
Loads a contract from bytes of JSON text.
sourcepub fn load_contract_from_str(&self, v: &str) -> Result<Contract, ArtifactError>
pub fn load_contract_from_str(&self, v: &str) -> Result<Contract, ArtifactError>
Loads a contract from string of JSON text.
sourcepub fn load_contract_from_value(
&self,
v: Value
) -> Result<Contract, ArtifactError>
pub fn load_contract_from_value(
&self,
v: Value
) -> Result<Contract, ArtifactError>
Loads a contract from a loaded JSON value.
sourcepub fn load_contract_from_file(
&self,
p: impl AsRef<Path>
) -> Result<Contract, ArtifactError>
pub fn load_contract_from_file(
&self,
p: impl AsRef<Path>
) -> Result<Contract, ArtifactError>
Loads a contract from disk.
sourcepub fn save_to_string(contract: &Contract) -> Result<String, ArtifactError>
pub fn save_to_string(contract: &Contract) -> Result<String, ArtifactError>
Serializes a single contract.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TruffleLoader
impl Send for TruffleLoader
impl Sync for TruffleLoader
impl Unpin for TruffleLoader
impl UnwindSafe for TruffleLoader
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