pub trait View: Send + Sync {
// Required methods
fn route(&self) -> &'static str;
fn heading(&self) -> &'static str;
fn param_keys(&self, ctx: &Context) -> Result<Vec<String>, ApiError>;
fn handle_get(
&self,
query: &BTreeMap<String, String>,
ctx: &Context,
) -> Result<String, ApiError>;
}Expand description
The object-safe façade the router dispatches through, as crate::Table
is for tables. A blanket implementation covers every ViewLogic, so
nothing outside this module implements it.
Required Methods§
Sourcefn route(&self) -> &'static str
fn route(&self) -> &'static str
The route segment, from ViewLogic::name.
Sourcefn heading(&self) -> &'static str
fn heading(&self) -> &'static str
The shell’s heading, from ViewLogic::title.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".