pub struct Proposal {
pub agent: AgentName,
pub text: String,
pub impact: Impact,
pub at: Timestamp,
}Expand description
What an agent submitted.
Fields§
§agent: AgentNameWho proposed it.
text: StringThe insight, in one or two sentences.
impact: ImpactHow much the agent thinks it matters.
at: TimestampWhen it was proposed.
Implementations§
Source§impl Proposal
impl Proposal
Sourcepub fn new(
agent: AgentName,
text: impl Into<String>,
impact: Impact,
at: Timestamp,
) -> Self
pub fn new( agent: AgentName, text: impl Into<String>, impact: Impact, at: Timestamp, ) -> Self
Records a proposal.
Sourcepub fn is_well_formed(&self) -> bool
pub fn is_well_formed(&self) -> bool
Returns true when the text is usable.
Only length and emptiness. Judging whether an insight is good is not something a validator can do, and pretending otherwise would reject useful things.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Proposal
impl<'de> Deserialize<'de> for Proposal
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 StructuralPartialEq for Proposal
Auto Trait Implementations§
impl Freeze for Proposal
impl RefUnwindSafe for Proposal
impl Send for Proposal
impl Sync for Proposal
impl Unpin for Proposal
impl UnsafeUnpin for Proposal
impl UnwindSafe for Proposal
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