pub struct Proposal { /* private fields */ }Expand description
Authored proposal inside a deliberation.
Implementations§
Source§impl Proposal
impl Proposal
Sourcepub fn new(
id: ProposalId,
author: AgentId,
specialty: Specialty,
content: impl Into<ProposalContent>,
attributes: Attributes,
now: OffsetDateTime,
) -> Result<Self, DomainError>
pub fn new( id: ProposalId, author: AgentId, specialty: Specialty, content: impl Into<ProposalContent>, attributes: Attributes, now: OffsetDateTime, ) -> Result<Self, DomainError>
Create a new proposal.
The content must not be empty.
Sourcepub fn revise(
&mut self,
new_content: impl Into<ProposalContent>,
now: OffsetDateTime,
) -> Result<(), DomainError>
pub fn revise( &mut self, new_content: impl Into<ProposalContent>, now: OffsetDateTime, ) -> Result<(), DomainError>
Replace the content (e.g. after peer-review revision).
Increments the revision counter and refreshes updated_at.
pub fn id(&self) -> &ProposalId
pub fn specialty(&self) -> &Specialty
pub const fn content(&self) -> &ProposalContent
pub fn attributes(&self) -> &Attributes
pub fn created_at(&self) -> OffsetDateTime
pub fn updated_at(&self) -> OffsetDateTime
pub fn revision_count(&self) -> u32
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 Eq for Proposal
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