pub struct Surface {
pub actions: Vec<Action>,
pub views: Vec<View>,
}Expand description
What a module declares from Module::surface.
Fields§
§actions: Vec<Action>§views: Vec<View>Implementations§
Source§impl Surface
impl Surface
Sourcepub fn none() -> Self
pub fn none() -> Self
A module with no UI. The default of Module::surface.
pub fn new() -> Self
pub fn action(self, action: Action) -> Self
pub fn view(self, view: View) -> Self
Sourcepub fn validate(&self, module: &str, errors: &mut ConfigError)
pub fn validate(&self, module: &str, errors: &mut ConfigError)
Validates the declaration for module into errors, collecting
every problem (the Harness::build convention): duplicate or
malformed action names, paths not starting with /, an Admin
action outside /admin/ (or a non-admin one inside it), an input
schema that is not an object, and views naming unknown actions.
Sourcepub fn public(&self) -> Surface
pub fn public(&self) -> Surface
The subset a renderer may show without the admin session: every
non-admin action that is not a machine route, and every view that
references only those. Signature
actions (webhooks) are called by providers, never by browsers —
exposing them in the public surface was part of the issue #133
confusion (a captcha widget rendered on a route no human submits).