mlb_api/hydrations.rs
1//! General hydrations types for the hydrations system
2//!
3//! Everything here is rather internal, not much will be of interest
4
5use std::borrow::Cow;
6use std::fmt::Debug;
7use serde::de::DeserializeOwned;
8
9#[doc(hidden)]
10pub trait Hydrations: 'static + Debug + DeserializeOwned + PartialEq + Clone {
11 type RequestData;
12
13 fn hydration_text(data: &Self::RequestData) -> Cow<'static, str>;
14}
15
16impl Hydrations for () {
17 type RequestData = ();
18
19 fn hydration_text((): &()) -> Cow<'static, str> {
20 Cow::Borrowed("")
21 }
22}