Struct nnsdao_sdk_basic::DaoBasic
source · [−]pub struct DaoBasic<T: DaoCustomFn> {
pub proposal_list: HashMap<u64, Proposal>,
pub next_proposal_id: u64,
pub custom_fn: T,
}
Expand description
Basic DAO structure
Fields
proposal_list: HashMap<u64, Proposal>
next_proposal_id: u64
custom_fn: T
Implementations
sourceimpl<T> DaoBasic<T> where
T: DaoCustomFn,
impl<T> DaoBasic<T> where
T: DaoCustomFn,
Implements the most basic DAO functionality
sourcepub async fn proposal(&mut self, arg: ProposalArg) -> Result<Proposal, String>
pub async fn proposal(&mut self, arg: ProposalArg) -> Result<Proposal, String>
Submit the proposal
pub fn get_proposal(&self, id: u64) -> Result<Proposal, String>
pub fn proposal_list(&self) -> HashMap<u64, Proposal>
pub async fn vote(&mut self, arg: VotesArg) -> Result<(), String>
pub async fn handle_proposal(&self) -> Result<(), String>
pub fn change_proposal_state(
&mut self,
arg: ChangeProposalStateArg
) -> Result<(), String>
Trait Implementations
sourceimpl<T: DaoCustomFn + CandidType> CandidType for DaoBasic<T>
impl<T: DaoCustomFn + CandidType> CandidType for DaoBasic<T>
sourceimpl<T: Clone + DaoCustomFn> Clone for DaoBasic<T>
impl<T: Clone + DaoCustomFn> Clone for DaoBasic<T>
sourceimpl<T: Debug + DaoCustomFn> Debug for DaoBasic<T>
impl<T: Debug + DaoCustomFn> Debug for DaoBasic<T>
sourceimpl<T: Default + DaoCustomFn> Default for DaoBasic<T>
impl<T: Default + DaoCustomFn> Default for DaoBasic<T>
sourceimpl<'de, T: DaoCustomFn> Deserialize<'de> for DaoBasic<T> where
T: Deserialize<'de>,
impl<'de, T: DaoCustomFn> Deserialize<'de> for DaoBasic<T> where
T: Deserialize<'de>,
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
Auto Trait Implementations
impl<T> RefUnwindSafe for DaoBasic<T> where
T: RefUnwindSafe,
impl<T> Send for DaoBasic<T> where
T: Send,
impl<T> Sync for DaoBasic<T> where
T: Sync,
impl<T> Unpin for DaoBasic<T> where
T: Unpin,
impl<T> UnwindSafe for DaoBasic<T> where
T: UnwindSafe,
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