pub struct Goal {
pub id: Option<i64>,
pub project_id: Option<i64>,
pub name: String,
pub description: Option<String>,
pub target_hours: f64,
pub start_date: Option<NaiveDate>,
pub end_date: Option<NaiveDate>,
pub current_progress: f64,
pub status: GoalStatus,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Fields§
§id: Option<i64>§project_id: Option<i64>§name: String§description: Option<String>§target_hours: f64§start_date: Option<NaiveDate>§end_date: Option<NaiveDate>§current_progress: f64§status: GoalStatus§created_at: DateTime<Utc>§updated_at: DateTime<Utc>Implementations§
Source§impl Goal
impl Goal
pub fn new(name: String, target_hours: f64) -> Self
pub fn with_project(self, project_id: i64) -> Self
pub fn with_description(self, description: String) -> Self
pub fn with_dates( self, start: Option<NaiveDate>, end: Option<NaiveDate>, ) -> Self
pub fn progress_percentage(&self) -> f64
pub fn is_completed(&self) -> bool
pub fn remaining_hours(&self) -> f64
pub fn update_progress(&mut self, hours: f64)
pub fn validate(&self) -> Result<()>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Goal
impl<'de> Deserialize<'de> for Goal
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 Goal
Auto Trait Implementations§
impl Freeze for Goal
impl RefUnwindSafe for Goal
impl Send for Goal
impl Sync for Goal
impl Unpin for Goal
impl UnwindSafe for Goal
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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