use crate::lang::arity::Arity;
use crate::value::Value;
use crate::value::keys::Keys;
use crate::value::map::Map;
use crate::value::operation;
use crate::value::operation::Operation;
use crate::value::span::Span;
pub trait Adapter: core::fmt::Debug {
fn template_source(&self) -> Option<&str> {
None
}
fn template_span(&self) -> Option<Span> {
None
}
fn value_get(&self, map: &Map, keys: &Keys) -> Option<Value> {
operation::get_map_value(map, keys)
}
#[doc(hidden)]
fn record_setter(&self, _: &Value) -> Result<Option<Operation>, String> {
Ok(None)
}
#[doc(hidden)]
fn record_getter(&self, _: &Value) -> Result<Option<Operation>, String> {
Ok(None)
}
#[doc(hidden)]
fn record_operation(&self, _: &Operation) -> Result<(), String> {
Ok(())
}
#[doc(hidden)]
fn erase_operation(&self, _: &Value) -> Result<Vec<Operation>, String> {
Ok(Vec::default())
}
fn func_find(&self, _: &[u8]) -> Option<Arity> {
None
}
fn func_call(&self, _: &[u8], _: Vec<Option<Value>>) -> Result<Option<Value>, String> {
Ok(None)
}
}
#[derive(Debug, Default)]
pub struct Default {
_private: (),
}
impl super::Adapter for Default {}