Struct cw4::Cw4Contract
source · [−]pub struct Cw4Contract(pub Addr);
Expand description
Cw4Contract is a wrapper around Addr that provides a lot of helpers for working with cw4 contracts
If you wish to persist this, convert to Cw4CanonicalContract via .canonical()
Tuple Fields
0: Addr
Implementations
sourceimpl Cw4Contract
impl Cw4Contract
pub fn new(addr: Addr) -> Self
pub fn addr(&self) -> Addr
pub fn add_hook<T: Into<String>>(&self, addr: T) -> StdResult<CosmosMsg>
pub fn remove_hook<T: Into<String>>(&self, addr: T) -> StdResult<CosmosMsg>
pub fn update_admin<T: Into<String>>(
&self,
admin: Option<T>
) -> StdResult<CosmosMsg>
sourcepub fn hooks<Q: CustomQuery>(
&self,
querier: &QuerierWrapper<'_, Q>
) -> StdResult<Vec<String>>
pub fn hooks<Q: CustomQuery>(
&self,
querier: &QuerierWrapper<'_, Q>
) -> StdResult<Vec<String>>
Show the hooks
sourcepub fn total_weight(&self, querier: &QuerierWrapper<'_>) -> StdResult<u64>
pub fn total_weight(&self, querier: &QuerierWrapper<'_>) -> StdResult<u64>
Read the total weight
sourcepub fn is_member(
&self,
querier: &QuerierWrapper<'_>,
member: &Addr,
height: Option<u64>
) -> StdResult<Option<u64>>
pub fn is_member(
&self,
querier: &QuerierWrapper<'_>,
member: &Addr,
height: Option<u64>
) -> StdResult<Option<u64>>
Check if this address is a member and returns its weight
sourcepub fn is_voting_member(
&self,
querier: &QuerierWrapper<'_>,
member: &Addr,
height: impl Into<Option<u64>>
) -> StdResult<Option<u64>>
pub fn is_voting_member(
&self,
querier: &QuerierWrapper<'_>,
member: &Addr,
height: impl Into<Option<u64>>
) -> StdResult<Option<u64>>
Check if this address is a member, and if its weight is >= 1 Returns member’s weight in positive case
sourcepub fn member_at_height(
&self,
querier: &QuerierWrapper<'_>,
member: impl Into<String>,
at_height: Option<u64>
) -> StdResult<Option<u64>>
pub fn member_at_height(
&self,
querier: &QuerierWrapper<'_>,
member: impl Into<String>,
at_height: Option<u64>
) -> StdResult<Option<u64>>
Return the member’s weight at the given snapshot - requires a smart query
pub fn list_members(
&self,
querier: &QuerierWrapper<'_>,
start_after: Option<String>,
limit: Option<u32>
) -> StdResult<Vec<Member>>
Trait Implementations
sourceimpl Clone for Cw4Contract
impl Clone for Cw4Contract
sourcefn clone(&self) -> Cw4Contract
fn clone(&self) -> Cw4Contract
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 Cw4Contract
impl Debug for Cw4Contract
sourceimpl<'de> Deserialize<'de> for Cw4Contract
impl<'de> Deserialize<'de> for Cw4Contract
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 JsonSchema for Cw4Contract
impl JsonSchema for Cw4Contract
sourcefn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
sourcefn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
sourcefn 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 more
sourceimpl PartialEq<Cw4Contract> for Cw4Contract
impl PartialEq<Cw4Contract> for Cw4Contract
sourcefn eq(&self, other: &Cw4Contract) -> bool
fn eq(&self, other: &Cw4Contract) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Cw4Contract) -> bool
fn ne(&self, other: &Cw4Contract) -> bool
This method tests for !=
.
sourceimpl Serialize for Cw4Contract
impl Serialize for Cw4Contract
impl StructuralPartialEq for Cw4Contract
Auto Trait Implementations
impl RefUnwindSafe for Cw4Contract
impl Send for Cw4Contract
impl Sync for Cw4Contract
impl Unpin for Cw4Contract
impl UnwindSafe for Cw4Contract
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> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more