mastodon-notifier 0.1.0

Mastodon desktop notification daemon
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use anyhow::Result;
use keyring::Entry;

pub fn get(app: &str, username: &str) -> Result<String> {
    let entry = Entry::new(app, username);

    entry.get_password().map(Ok)?
}

pub fn set(app: &str, username: &str, token: &str) -> Result<()> {
    let entry = Entry::new(app, username);

    entry.set_password(token).map(Ok)?
}