fedimovies/src/mastodon_api/directory/types.rs

25 lines
482 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;
2023-04-24 15:35:32 +00:00
fn default_page_size() -> PageSize {
PageSize::new(40)
}
2021-12-16 23:00:52 +00:00
2023-04-24 15:35:32 +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
}