pub struct NewProject {
pub title: String,
pub filename: Option<String>,
pub status: Option<ProjectStatus>,
pub description: Option<String>,
pub area: Option<FileReference>,
pub start_date: Option<NaiveDate>,
pub end_date: Option<NaiveDate>,
pub body: String,
pub extra: HashMap<String, Value>,
}Expand description
Data for creating a new project.
Fields§
§title: StringThe project title (required).
filename: Option<String>Optional custom filename.
status: Option<ProjectStatus>Initial status.
description: Option<String>Brief description.
area: Option<FileReference>Reference to the area.
start_date: Option<NaiveDate>Start date.
end_date: Option<NaiveDate>End date.
body: StringMarkdown body.
extra: HashMap<String, Value>Additional frontmatter fields.
Implementations§
Source§impl NewProject
impl NewProject
Sourcepub fn with_filename(self, filename: impl Into<String>) -> Self
pub fn with_filename(self, filename: impl Into<String>) -> Self
Set a custom filename.
Sourcepub fn with_status(self, status: ProjectStatus) -> Self
pub fn with_status(self, status: ProjectStatus) -> Self
Set the status.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the description.
Sourcepub fn in_area(self, area: impl Into<FileReference>) -> Self
pub fn in_area(self, area: impl Into<FileReference>) -> Self
Assign to an area.
Sourcepub fn with_start_date(self, date: NaiveDate) -> Self
pub fn with_start_date(self, date: NaiveDate) -> Self
Set the start date.
Sourcepub fn with_end_date(self, date: NaiveDate) -> Self
pub fn with_end_date(self, date: NaiveDate) -> Self
Set the end date.
Trait Implementations§
Source§impl Clone for NewProject
impl Clone for NewProject
Source§fn clone(&self) -> NewProject
fn clone(&self) -> NewProject
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NewProject
impl Debug for NewProject
Source§impl Default for NewProject
impl Default for NewProject
Source§fn default() -> NewProject
fn default() -> NewProject
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NewProject
impl RefUnwindSafe for NewProject
impl Send for NewProject
impl Sync for NewProject
impl Unpin for NewProject
impl UnwindSafe for NewProject
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more