pub struct TargetRepository { /* private fields */ }Implementations§
Source§impl TargetRepository
impl TargetRepository
pub fn new(path: PathBuf) -> Self
pub fn load(&self) -> Result<(), EnvelopeError>
pub fn save(&self) -> Result<(), EnvelopeError>
pub fn get( &self, id: BudgetTargetId, ) -> Result<Option<BudgetTarget>, EnvelopeError>
pub fn get_for_category( &self, category_id: CategoryId, ) -> Result<Option<BudgetTarget>, EnvelopeError>
pub fn get_all_active(&self) -> Result<Vec<BudgetTarget>, EnvelopeError>
pub fn upsert(&self, target: BudgetTarget) -> Result<(), EnvelopeError>
pub fn delete(&self, id: BudgetTargetId) -> Result<bool, EnvelopeError>
Auto Trait Implementations§
impl !Freeze for TargetRepository
impl RefUnwindSafe for TargetRepository
impl Send for TargetRepository
impl Sync for TargetRepository
impl Unpin for TargetRepository
impl UnwindSafe for TargetRepository
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