2022-11-27 14:44:43 +00:00
|
|
|
use std::borrow::Cow;
|
|
|
|
|
2022-11-29 23:50:29 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
2022-11-27 14:44:43 +00:00
|
|
|
/// Raw data about mastodon app. Save `Data` using `serde` to prevent needing
|
|
|
|
/// to authenticate on every run.
|
2022-11-29 23:50:29 +00:00
|
|
|
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize, Default)]
|
2022-11-27 14:44:43 +00:00
|
|
|
pub struct Data {
|
2022-11-29 23:50:29 +00:00
|
|
|
/// Base url of instance eg. `https://botsin.space`.
|
2022-11-27 14:44:43 +00:00
|
|
|
pub base: Cow<'static, str>,
|
|
|
|
/// The client's id given by the instance.
|
|
|
|
pub client_id: Cow<'static, str>,
|
|
|
|
/// The client's secret given by the instance.
|
|
|
|
pub client_secret: Cow<'static, str>,
|
|
|
|
/// Url to redirect back to your application from the instance signup.
|
|
|
|
pub redirect: Cow<'static, str>,
|
|
|
|
/// The client's access token.
|
|
|
|
pub token: Cow<'static, str>,
|
|
|
|
}
|