Path: blob/main/crates/polars-plan/src/dsl/expr/anonymous/json_schema.rs
8424 views
use std::sync::Arc;12use polars_core::series::Series;34use super::{AnonymousAgg, AnonymousColumnsUdf, SpecialEq};5use crate::dsl::LazySerde;67impl<T: schemars::JsonSchema> schemars::JsonSchema for SpecialEq<Arc<T>> {8fn schema_name() -> std::borrow::Cow<'static, str> {9T::schema_name()10}1112fn schema_id() -> std::borrow::Cow<'static, str> {13T::schema_id()14}1516fn json_schema(generator: &mut schemars::SchemaGenerator) -> schemars::Schema {17T::json_schema(generator)18}19}2021impl<T: schemars::JsonSchema + Clone> schemars::JsonSchema for LazySerde<T> {22fn schema_name() -> std::borrow::Cow<'static, str> {23T::schema_name()24}2526fn schema_id() -> std::borrow::Cow<'static, str> {27T::schema_id()28}2930fn json_schema(generator: &mut schemars::SchemaGenerator) -> schemars::Schema {31Vec::<u8>::json_schema(generator)32}33}3435impl schemars::JsonSchema for SpecialEq<Series> {36fn schema_name() -> std::borrow::Cow<'static, str> {37Series::schema_name()38}3940fn schema_id() -> std::borrow::Cow<'static, str> {41Series::schema_id()42}4344fn json_schema(generator: &mut schemars::SchemaGenerator) -> schemars::Schema {45Series::json_schema(generator)46}47}4849impl schemars::JsonSchema for SpecialEq<Arc<dyn AnonymousAgg>> {50fn schema_name() -> std::borrow::Cow<'static, str> {51"AnonymousAgg".into()52}5354fn schema_id() -> std::borrow::Cow<'static, str> {55std::borrow::Cow::Borrowed(concat!(module_path!(), "::", "AnonymousAgg"))56}5758fn json_schema(generator: &mut schemars::SchemaGenerator) -> schemars::Schema {59Vec::<u8>::json_schema(generator)60}61}6263impl schemars::JsonSchema for SpecialEq<Arc<dyn AnonymousColumnsUdf>> {64fn schema_name() -> std::borrow::Cow<'static, str> {65"AnonymousColumnsUdf".into()66}6768fn schema_id() -> std::borrow::Cow<'static, str> {69std::borrow::Cow::Borrowed(concat!(module_path!(), "::", "AnonymousColumnsUdf"))70}7172fn json_schema(generator: &mut schemars::SchemaGenerator) -> schemars::Schema {73Vec::<u8>::json_schema(generator)74}75}767778