pub struct Settings {
pub schema_version: u32,
pub budget_period_type: BudgetPeriodType,
pub encryption_enabled: bool,
pub encryption: EncryptionSettings,
pub backup_retention: BackupRetention,
pub currency_symbol: String,
pub date_format: String,
pub first_day_of_week: u8,
pub setup_completed: bool,
}Expand description
User settings for EnvelopeCLI
Fields§
§schema_version: u32Schema version for migration support
budget_period_type: BudgetPeriodTypeUser’s preferred budget period type
encryption_enabled: boolWhether encryption is enabled (legacy field for backwards compat)
encryption: EncryptionSettingsFull encryption settings
backup_retention: BackupRetentionBackup retention policy
currency_symbol: StringDefault currency symbol
date_format: StringDate format preference (strftime format)
first_day_of_week: u8First day of week (0 = Sunday, 1 = Monday)
setup_completed: boolWhether initial setup has been completed
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn is_encryption_enabled(&self) -> bool
pub fn is_encryption_enabled(&self) -> bool
Check if encryption is enabled (using new encryption field)
Sourcepub fn load_or_create(paths: &EnvelopePaths) -> Result<Self, EnvelopeError>
pub fn load_or_create(paths: &EnvelopePaths) -> Result<Self, EnvelopeError>
Load settings from disk, or create default settings if file doesn’t exist
Sourcepub fn save(&self, paths: &EnvelopePaths) -> Result<(), EnvelopeError>
pub fn save(&self, paths: &EnvelopePaths) -> Result<(), EnvelopeError>
Save settings to disk
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Settings
impl<'de> Deserialize<'de> for Settings
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
Auto Trait Implementations§
impl Freeze for Settings
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnwindSafe for Settings
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