bluejay_parser/ast/definition/
context.rs1use crate::ast::definition::CustomScalarTypeDefinition;
2use bluejay_core::Value;
3use std::borrow::Cow;
4
5pub trait Context: std::fmt::Debug + Sized {
6 fn coerce_custom_scalar_input<const CONST: bool>(
7 cstd: &CustomScalarTypeDefinition<Self>,
8 value: &impl Value<CONST>,
9 ) -> Result<(), Cow<'static, str>>;
10}
11
12#[derive(Debug)]
13pub struct DefaultContext;
14
15impl Context for DefaultContext {
16 fn coerce_custom_scalar_input<const CONST: bool>(
17 _cstd: &CustomScalarTypeDefinition<Self>,
18 _value: &impl Value<CONST>,
19 ) -> Result<(), Cow<'static, str>> {
20 Ok(())
21 }
22}