Function vatsim_utils::rest_api::get_atc_sessions
source · [−]pub async fn get_atc_sessions(
cid: u64,
page: Option<u64>,
specifier: Option<&str>,
start: Option<&str>,
date: Option<&str>
) -> Result<PaginatedResponse<AtcSessionEntry>, VatsimUtilError>
Expand description
Get a user’s ATC sessions.
A page number can optionally be specified.
A position specifier can optionally be specified. For information on what can be included, see this post.
Example
use vatsim_utils::rest_api::get_atc_sessions;
let connections = get_atc_sessions(1234567890, None, None, None, None).await.unwrap();
// or ...
let connections = get_atc_sessions(
1234567890,
Some(2),
Some("SAN_TWR"),
Some("2020-01-02"),
None,
)
.await
.unwrap();
Errors
This function can fail if the HTTP request fails or if the returned data does not match the schemas of the models passed to the deserializer.