use crate::responses::{GenericResponse, RedditResponse};
use serde::Deserialize;
use std::fmt::{Debug, Formatter};
#[derive(Deserialize)]
pub struct Listing<T> {
pub modhash: Option<String>,
pub after: Option<String>,
pub before: Option<String>,
pub children: Vec<T>,
}
impl<T: Debug> Debug for Listing<T> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "[Listing] Children Available: {}", self.children.len())
}
}
pub type GenericListing<T> = GenericResponse<Listing<GenericResponse<T>>>;
pub type RedditListing = GenericResponse<Listing<RedditResponse>>;
pub type ListingArray = Vec<RedditListing>;