use serde_json::Value;
pub(crate) trait Host: Send + Sync {
fn environment(&self) -> &str;
fn session(&self, key: &str) -> Result<Option<Value>, String>;
fn context(&self, key: &str) -> Result<Option<Value>, String>;
fn vite(&self, entries: &[String]) -> Result<String, String>;
fn vite_react_refresh(&self) -> Result<String, String>;
}
pub(crate) struct Standalone {
pub environment: String,
}
impl Host for Standalone {
fn environment(&self) -> &str {
&self.environment
}
fn session(&self, _: &str) -> Result<Option<Value>, String> {
Err("no session is available; @session needs the Laravel adapter".to_owned())
}
fn context(&self, _: &str) -> Result<Option<Value>, String> {
Err("no context is available; @context needs the Laravel adapter".to_owned())
}
fn vite(&self, _: &[String]) -> Result<String, String> {
Err("@vite needs the Laravel adapter, which knows where the Vite build is".to_owned())
}
fn vite_react_refresh(&self) -> Result<String, String> {
Err("@viteReactRefresh needs the Laravel adapter".to_owned())
}
}