Struct wasm_deploy::file::Config

source ·
pub struct Config {
    pub settings: UserSettings,
    pub shell_completion_dir: Option<PathBuf>,
    pub chains: Vec<ChainInfo>,
    pub envs: Vec<Env>,
    pub keys: Vec<SigningKey>,
}

Fields§

§settings: UserSettings§shell_completion_dir: Option<PathBuf>§chains: Vec<ChainInfo>§envs: Vec<Env>§keys: Vec<SigningKey>

Implementations§

source§

impl Config

source

pub fn init(settings: &WorkspaceSettings) -> Result<Config>

source

pub fn load(settings: &WorkspaceSettings) -> Result<Config>

source

pub fn save(&self, settings: &WorkspaceSettings) -> Result<()>

source

pub fn get_active_env(&self) -> Result<&Env, DeployError>

source

pub fn get_active_env_mut(&mut self) -> Result<&mut Env>

source

pub fn get_active_chain_info(&self) -> Result<&ChainInfo>

source

pub async fn get_active_key(&self) -> Result<SigningKey>

source

pub fn add_chain_from( &mut self, chain_info: ChainInfo ) -> Result<ChainInfo, DeployError>

source

pub async fn add_chain(&mut self) -> Result<ChainInfo>

source

pub fn add_contract_from( &mut self, new_contract: ContractInfo ) -> Result<ContractInfo>

Adds or replaces a contract

source

pub fn add_contract(&mut self) -> Result<ContractInfo>

source

pub fn get_contract_addr(&self, name: &str) -> Result<&String>

source

pub fn get_contract(&self, name: &str) -> Result<&ContractInfo>

source

pub fn get_contract_mut(&mut self, name: &str) -> Result<&mut ContractInfo>

source

pub fn add_key_from( &mut self, key: SigningKey ) -> Result<SigningKey, DeployError>

source

pub async fn add_key(&mut self) -> Result<SigningKey>

source

pub fn add_env(&mut self) -> Result<&mut Env>

source

pub fn change_env(&mut self) -> Result<()>

source

pub async fn get_rpc_client(&mut self) -> Result<HttpClient>

source

pub fn get_shell_completion_dir(&self) -> Option<&PathBuf>

source

pub fn set_shell_completion_dir( &mut self, settings: &WorkspaceSettings ) -> Result<Option<&PathBuf>>

Trait Implementations§

source§

impl Clone for Config

source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Config

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Config

source§

fn default() -> Config

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Config

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Config

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<M> AsAny for Mwhere M: Any,

§

fn as_any(&self) -> &(dyn Any + 'static)

source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for Twhere T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> NoneValue for Twhere T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> Serialize for Twhere T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,

source§

impl<T> Msg for Twhere T: Debug + Serialize + Send + Sync,