pub struct PasswordStore;Expand description
Pass process runner.
Implementations§
Source§impl PasswordStore
impl PasswordStore
Sourcepub fn get(path: &str) -> Result<(String, String)>
pub fn get(path: &str) -> Result<(String, String)>
Get the username and password a the specified path.
Examples found in repository?
examples/main.rs (line 28)
26fn main() {
27 PasswordStore::insert("pass", "password").unwrap();
28 let password = PasswordStore::get("pass");
29 println!("Password: {:?}", password);
30 let usernames = PasswordStore::get_usernames("pass").unwrap();
31 println!("Usernames: {:?}", usernames);
32 PasswordStore::remove("pass").unwrap();
33
34 PasswordStore::insert("test/pass", "password").unwrap();
35 let password = PasswordStore::get("test/pass");
36 println!("Password: {:?}", password);
37 let usernames = PasswordStore::get_usernames("test/pass").unwrap();
38 println!("Usernames: {:?}", usernames);
39 PasswordStore::remove("test/pass").unwrap();
40
41 PasswordStore::insert("test with spaces/pass with spaces", "password").unwrap();
42 let password = PasswordStore::get("test with spaces/pass with spaces");
43 println!("{:?}", password);
44 let usernames = PasswordStore::get_usernames("test with spaces").unwrap();
45 println!("{:?}", usernames);
46 PasswordStore::remove("test with spaces/pass with spaces").unwrap();
47
48 PasswordStore::generate("pass", true, 25).unwrap();
49 let password = PasswordStore::get("pass");
50 println!("Password: {:?}", password);
51 let usernames = PasswordStore::get_usernames("pass").unwrap();
52 println!("Usernames: {:?}", usernames);
53 PasswordStore::remove("pass").unwrap();
54}Sourcepub fn get_usernames(path: &str) -> Result<Vec<String>>
pub fn get_usernames(path: &str) -> Result<Vec<String>>
Get the list of usernames at the specified path.
Examples found in repository?
examples/main.rs (line 30)
26fn main() {
27 PasswordStore::insert("pass", "password").unwrap();
28 let password = PasswordStore::get("pass");
29 println!("Password: {:?}", password);
30 let usernames = PasswordStore::get_usernames("pass").unwrap();
31 println!("Usernames: {:?}", usernames);
32 PasswordStore::remove("pass").unwrap();
33
34 PasswordStore::insert("test/pass", "password").unwrap();
35 let password = PasswordStore::get("test/pass");
36 println!("Password: {:?}", password);
37 let usernames = PasswordStore::get_usernames("test/pass").unwrap();
38 println!("Usernames: {:?}", usernames);
39 PasswordStore::remove("test/pass").unwrap();
40
41 PasswordStore::insert("test with spaces/pass with spaces", "password").unwrap();
42 let password = PasswordStore::get("test with spaces/pass with spaces");
43 println!("{:?}", password);
44 let usernames = PasswordStore::get_usernames("test with spaces").unwrap();
45 println!("{:?}", usernames);
46 PasswordStore::remove("test with spaces/pass with spaces").unwrap();
47
48 PasswordStore::generate("pass", true, 25).unwrap();
49 let password = PasswordStore::get("pass");
50 println!("Password: {:?}", password);
51 let usernames = PasswordStore::get_usernames("pass").unwrap();
52 println!("Usernames: {:?}", usernames);
53 PasswordStore::remove("pass").unwrap();
54}Sourcepub fn generate(path: &str, use_symbols: bool, length: i32) -> Result<()>
pub fn generate(path: &str, use_symbols: bool, length: i32) -> Result<()>
Generate a password in the store.
Examples found in repository?
examples/main.rs (line 48)
26fn main() {
27 PasswordStore::insert("pass", "password").unwrap();
28 let password = PasswordStore::get("pass");
29 println!("Password: {:?}", password);
30 let usernames = PasswordStore::get_usernames("pass").unwrap();
31 println!("Usernames: {:?}", usernames);
32 PasswordStore::remove("pass").unwrap();
33
34 PasswordStore::insert("test/pass", "password").unwrap();
35 let password = PasswordStore::get("test/pass");
36 println!("Password: {:?}", password);
37 let usernames = PasswordStore::get_usernames("test/pass").unwrap();
38 println!("Usernames: {:?}", usernames);
39 PasswordStore::remove("test/pass").unwrap();
40
41 PasswordStore::insert("test with spaces/pass with spaces", "password").unwrap();
42 let password = PasswordStore::get("test with spaces/pass with spaces");
43 println!("{:?}", password);
44 let usernames = PasswordStore::get_usernames("test with spaces").unwrap();
45 println!("{:?}", usernames);
46 PasswordStore::remove("test with spaces/pass with spaces").unwrap();
47
48 PasswordStore::generate("pass", true, 25).unwrap();
49 let password = PasswordStore::get("pass");
50 println!("Password: {:?}", password);
51 let usernames = PasswordStore::get_usernames("pass").unwrap();
52 println!("Usernames: {:?}", usernames);
53 PasswordStore::remove("pass").unwrap();
54}Sourcepub fn insert(path: &str, password: &str) -> Result<()>
pub fn insert(path: &str, password: &str) -> Result<()>
Insert a password in the store.
Examples found in repository?
examples/main.rs (line 27)
26fn main() {
27 PasswordStore::insert("pass", "password").unwrap();
28 let password = PasswordStore::get("pass");
29 println!("Password: {:?}", password);
30 let usernames = PasswordStore::get_usernames("pass").unwrap();
31 println!("Usernames: {:?}", usernames);
32 PasswordStore::remove("pass").unwrap();
33
34 PasswordStore::insert("test/pass", "password").unwrap();
35 let password = PasswordStore::get("test/pass");
36 println!("Password: {:?}", password);
37 let usernames = PasswordStore::get_usernames("test/pass").unwrap();
38 println!("Usernames: {:?}", usernames);
39 PasswordStore::remove("test/pass").unwrap();
40
41 PasswordStore::insert("test with spaces/pass with spaces", "password").unwrap();
42 let password = PasswordStore::get("test with spaces/pass with spaces");
43 println!("{:?}", password);
44 let usernames = PasswordStore::get_usernames("test with spaces").unwrap();
45 println!("{:?}", usernames);
46 PasswordStore::remove("test with spaces/pass with spaces").unwrap();
47
48 PasswordStore::generate("pass", true, 25).unwrap();
49 let password = PasswordStore::get("pass");
50 println!("Password: {:?}", password);
51 let usernames = PasswordStore::get_usernames("pass").unwrap();
52 println!("Usernames: {:?}", usernames);
53 PasswordStore::remove("pass").unwrap();
54}Sourcepub fn remove(path: &str) -> Result<()>
pub fn remove(path: &str) -> Result<()>
Remove a password from the store.
Examples found in repository?
examples/main.rs (line 32)
26fn main() {
27 PasswordStore::insert("pass", "password").unwrap();
28 let password = PasswordStore::get("pass");
29 println!("Password: {:?}", password);
30 let usernames = PasswordStore::get_usernames("pass").unwrap();
31 println!("Usernames: {:?}", usernames);
32 PasswordStore::remove("pass").unwrap();
33
34 PasswordStore::insert("test/pass", "password").unwrap();
35 let password = PasswordStore::get("test/pass");
36 println!("Password: {:?}", password);
37 let usernames = PasswordStore::get_usernames("test/pass").unwrap();
38 println!("Usernames: {:?}", usernames);
39 PasswordStore::remove("test/pass").unwrap();
40
41 PasswordStore::insert("test with spaces/pass with spaces", "password").unwrap();
42 let password = PasswordStore::get("test with spaces/pass with spaces");
43 println!("{:?}", password);
44 let usernames = PasswordStore::get_usernames("test with spaces").unwrap();
45 println!("{:?}", usernames);
46 PasswordStore::remove("test with spaces/pass with spaces").unwrap();
47
48 PasswordStore::generate("pass", true, 25).unwrap();
49 let password = PasswordStore::get("pass");
50 println!("Password: {:?}", password);
51 let usernames = PasswordStore::get_usernames("pass").unwrap();
52 println!("Usernames: {:?}", usernames);
53 PasswordStore::remove("pass").unwrap();
54}Auto Trait Implementations§
impl Freeze for PasswordStore
impl RefUnwindSafe for PasswordStore
impl Send for PasswordStore
impl Sync for PasswordStore
impl Unpin for PasswordStore
impl UnsafeUnpin for PasswordStore
impl UnwindSafe for PasswordStore
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