fedimovies/src/mastodon_api/directory/types.rs

21 lines
474 B
Rust
Raw Normal View History

2021-12-16 23:00:52 +00:00
use serde::Deserialize;
2022-09-29 21:15:54 +00:00
use crate::mastodon_api::pagination::PageSize;
fn default_page_size() -> PageSize { PageSize::new(40) }
2021-12-16 23:00:52 +00:00
fn default_only_local() -> bool { true }
2021-12-16 23:00:52 +00:00
/// https://docs.joinmastodon.org/methods/instance/directory/
#[derive(Deserialize)]
pub struct DirectoryQueryParams {
#[serde(default)]
2022-09-29 21:36:55 +00:00
pub offset: u16,
2021-12-16 23:00:52 +00:00
#[serde(default = "default_page_size")]
2022-09-29 21:15:54 +00:00
pub limit: PageSize,
#[serde(default = "default_only_local")]
pub local: bool,
2021-12-16 23:00:52 +00:00
}