pub struct Proposal<P> {
pub title: String,
pub description: String,
pub start_height: u64,
pub created_by: String,
pub expires: Expiration,
pub proposal: P,
pub status: Status,
pub rules: VotingRules,
pub total_points: u64,
pub votes: Votes,
}Fields§
§title: String§description: String§start_height: u64§created_by: String§expires: Expiration§proposal: P§status: Status§rules: VotingRulespass requirements
total_points: u64§votes: VotesImplementations§
Source§impl<P> Proposal<P>
impl<P> Proposal<P>
Sourcepub fn current_status(&self, block: &BlockInfo) -> Status
pub fn current_status(&self, block: &BlockInfo) -> Status
current_status is non-mutable and returns what the status should be. (designed for queries)
Sourcepub fn update_status(&mut self, block: &BlockInfo)
pub fn update_status(&mut self, block: &BlockInfo)
update_status sets the status of the proposal to current_status. (designed for handler logic)
pub fn is_passed(&self, block: &BlockInfo) -> bool
Trait Implementations§
Source§impl<'de, P> Deserialize<'de> for Proposal<P>where
P: Deserialize<'de>,
impl<'de, P> Deserialize<'de> for Proposal<P>where
P: Deserialize<'de>,
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
impl<P: Eq> Eq for Proposal<P>
Source§impl<P> From<Proposal<P>> for ProposalInfo
impl<P> From<Proposal<P>> for ProposalInfo
Source§impl<P: JsonSchema> JsonSchema for Proposal<P>
impl<P: JsonSchema> JsonSchema for Proposal<P>
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(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &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 moreimpl<P: PartialEq> StructuralPartialEq for Proposal<P>
Auto Trait Implementations§
impl<P> Freeze for Proposal<P>where
P: Freeze,
impl<P> RefUnwindSafe for Proposal<P>where
P: RefUnwindSafe,
impl<P> Send for Proposal<P>where
P: Send,
impl<P> Sync for Proposal<P>where
P: Sync,
impl<P> Unpin for Proposal<P>where
P: Unpin,
impl<P> UnsafeUnpin for Proposal<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for Proposal<P>where
P: UnwindSafe,
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