Module ytmapi_rs::parse

source ·
Expand description

Results from parsing Innertube queries.

§Implementation example

use serde::Deserialize;
#[derive(Debug, Deserialize)]
struct Date {
    date_string: String,
    date_timestamp: usize,
}
impl ytmapi_rs::parse::ParseFrom<GetDateQuery> for Date {
    fn parse_from(
        p: ytmapi_rs::parse::ProcessedResult<GetDateQuery>,
    ) -> ytmapi_rs::Result<Self> {
        ytmapi_rs::json::from_json(p.json)
    }
}

§Alternative implementation

An alternative to working directly with crate::json::Json is to add json-crawler as a dependency and use the provided From<ProcessedResult> for JsonCrawlerOwned implementation.

Structs§

Enums§

Traits§

  • Describes how to parse the ProcessedResult from a Query into the target type.