Struct cw3::Cw3Contract
source · pub struct Cw3Contract(pub Addr);
Expand description
Cw3Contract is a wrapper around Addr that provides a lot of helpers for working with this.
If you wish to persist this, convert to Cw3CanonicalContract via .canonical()
FIXME: Cw3Contract currently only supports CosmosMsg
Tuple Fields§
§0: Addr
Implementations§
source§impl Cw3Contract
impl Cw3Contract
pub fn addr(&self) -> Addr
pub fn encode_msg(&self, msg: Cw3ExecuteMsg) -> StdResult<CosmosMsg>
sourcepub fn proposal<T: Into<String>, U: Into<String>>(
&self,
title: T,
description: U,
msgs: Vec<CosmosMsg>,
earliest: Option<Expiration>,
latest: Option<Expiration>
) -> StdResult<CosmosMsg>
pub fn proposal<T: Into<String>, U: Into<String>>( &self, title: T, description: U, msgs: Vec<CosmosMsg>, earliest: Option<Expiration>, latest: Option<Expiration> ) -> StdResult<CosmosMsg>
helper doesn’t support custom messages now
pub fn vote(&self, proposal_id: u64, vote: Vote) -> StdResult<CosmosMsg>
pub fn execute(&self, proposal_id: u64) -> StdResult<CosmosMsg>
pub fn close(&self, proposal_id: u64) -> StdResult<CosmosMsg>
Trait Implementations§
source§impl Clone for Cw3Contract
impl Clone for Cw3Contract
source§fn clone(&self) -> Cw3Contract
fn clone(&self) -> Cw3Contract
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Cw3Contract
impl Debug for Cw3Contract
source§impl<'de> Deserialize<'de> for Cw3Contract
impl<'de> Deserialize<'de> for Cw3Contract
source§fn 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
source§impl JsonSchema for Cw3Contract
impl JsonSchema for Cw3Contract
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl PartialEq for Cw3Contract
impl PartialEq for Cw3Contract
source§fn eq(&self, other: &Cw3Contract) -> bool
fn eq(&self, other: &Cw3Contract) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Cw3Contract
impl Serialize for Cw3Contract
impl StructuralPartialEq for Cw3Contract
Auto Trait Implementations§
impl Freeze for Cw3Contract
impl RefUnwindSafe for Cw3Contract
impl Send for Cw3Contract
impl Sync for Cw3Contract
impl Unpin for Cw3Contract
impl UnwindSafe for Cw3Contract
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
Mutably borrows from an owned value. Read more