pub struct IncomeRepository { /* private fields */ }Expand description
Repository for income expectations
Implementations§
Source§impl IncomeRepository
impl IncomeRepository
Sourcepub fn load(&self) -> Result<(), EnvelopeError>
pub fn load(&self) -> Result<(), EnvelopeError>
Load expectations from disk
Sourcepub fn save(&self) -> Result<(), EnvelopeError>
pub fn save(&self) -> Result<(), EnvelopeError>
Save expectations to disk
Sourcepub fn get_for_period(&self, period: &BudgetPeriod) -> Option<IncomeExpectation>
pub fn get_for_period(&self, period: &BudgetPeriod) -> Option<IncomeExpectation>
Get income expectation for a period
Sourcepub fn get(
&self,
id: IncomeId,
) -> Result<Option<IncomeExpectation>, EnvelopeError>
pub fn get( &self, id: IncomeId, ) -> Result<Option<IncomeExpectation>, EnvelopeError>
Get income expectation by ID
Sourcepub fn upsert(
&self,
expectation: IncomeExpectation,
) -> Result<(), EnvelopeError>
pub fn upsert( &self, expectation: IncomeExpectation, ) -> Result<(), EnvelopeError>
Upsert an income expectation (insert or update)
Sourcepub fn delete_for_period(
&self,
period: &BudgetPeriod,
) -> Option<IncomeExpectation>
pub fn delete_for_period( &self, period: &BudgetPeriod, ) -> Option<IncomeExpectation>
Delete income expectation for a period
Sourcepub fn get_all(&self) -> Result<Vec<IncomeExpectation>, EnvelopeError>
pub fn get_all(&self) -> Result<Vec<IncomeExpectation>, EnvelopeError>
Get all income expectations
Auto Trait Implementations§
impl !Freeze for IncomeRepository
impl RefUnwindSafe for IncomeRepository
impl Send for IncomeRepository
impl Sync for IncomeRepository
impl Unpin for IncomeRepository
impl UnwindSafe for IncomeRepository
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> 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