pub struct Profile {
pub encrypted: bool,
pub notes: Vec<Item>,
}Expand description
Main container of a theca profile file
Fields§
§encrypted: bool§notes: Vec<Item>Implementations§
Source§impl Profile
impl Profile
Sourcepub fn new(
profile_name: &str,
profile_folder: &str,
key: &str,
new_profile: bool,
encrypted: bool,
yes: bool,
) -> Result<(Profile, u64)>
pub fn new( profile_name: &str, profile_folder: &str, key: &str, new_profile: bool, encrypted: bool, yes: bool, ) -> Result<(Profile, u64)>
setup a Profile struct based on the command line arguments
Sourcepub fn save_to_file(&mut self, args: &Args, fingerprint: &u64) -> Result<()>
pub fn save_to_file(&mut self, args: &Args, fingerprint: &u64) -> Result<()>
save the profile back to file (either plaintext or encrypted)
Sourcepub fn transfer_note(&mut self, args: &Args) -> Result<()>
pub fn transfer_note(&mut self, args: &Args) -> Result<()>
transfer a note from the profile to another profile
Sourcepub fn add_note(
&mut self,
title: &str,
body: &[String],
status: Option<Status>,
use_stdin: bool,
use_editor: bool,
print_msg: bool,
) -> Result<()>
pub fn add_note( &mut self, title: &str, body: &[String], status: Option<Status>, use_stdin: bool, use_editor: bool, print_msg: bool, ) -> Result<()>
add a item to the profile
Sourcepub fn delete_note(&mut self, id: &[usize])
pub fn delete_note(&mut self, id: &[usize])
delete an item from the profile
Sourcepub fn edit_note(
&mut self,
id: usize,
title: &str,
body: &[String],
status: Option<Status>,
use_stdin: bool,
flags: BoolFlags,
) -> Result<()>
pub fn edit_note( &mut self, id: usize, title: &str, body: &[String], status: Option<Status>, use_stdin: bool, flags: BoolFlags, ) -> Result<()>
edit an item in the profile
Sourcepub fn view_note(
&mut self,
id: usize,
json: bool,
condensed: bool,
) -> Result<()>
pub fn view_note( &mut self, id: usize, json: bool, condensed: bool, ) -> Result<()>
print a full item
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Profile
impl RefUnwindSafe for Profile
impl Send for Profile
impl Sync for Profile
impl Unpin for Profile
impl UnwindSafe for Profile
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)