pub struct Cms { /* private fields */ }Expand description
A small content store with an editor.
Implementations§
Source§impl Cms
impl Cms
Sourcepub fn new() -> Self
pub fn new() -> Self
A CMS that, until Cms::collections or Cms::any_collection says
otherwise, allows no collection — so a misconfigured venture refuses
content rather than accepting anything.
Sourcepub fn collections(
self,
collections: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn collections( self, collections: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Exactly these collection slugs may hold content.
Sourcepub fn any_collection(self) -> Self
pub fn any_collection(self) -> Self
Accept any collection slug.
Trait Implementations§
Source§impl Module for Cms
impl Module for Cms
Source§fn requires(&self) -> &'static [Port]
fn requires(&self) -> &'static [Port]
Ports the module cannot run without; missing = build error.
Source§fn tables(&self) -> &'static [&'static str]
fn tables(&self) -> &'static [&'static str]
Table names this module owns; duplicates across modules are a build
error.
Source§fn migrations(&self) -> Migrations
fn migrations(&self) -> Migrations
The module’s migrations, embedded per dialect.
Source§fn validate_config(&self, cfg: &dyn Config) -> Result<(), ConfigError>
fn validate_config(&self, cfg: &dyn Config) -> Result<(), ConfigError>
Rejects invalid configuration: missing required keys or malformed
values, reported together with the module name. Read more
Source§fn router(&self, ctx: ModuleContext) -> Router
fn router(&self, ctx: ModuleContext) -> Router
The module’s router, nested under
/v1/<name>.Source§fn surface(&self) -> Surface
fn surface(&self) -> Surface
The module’s UI surface (ADR 0010): the actions a renderer may
offer and the views that compose them. Input schemas come from
the handler’s own body types (
Action::input::<Body>()), so the
declaration cannot drift from the route. Harness::build
validates it; GET /__surface serves the composition. Default:
nothing, and a module that declares nothing renders nothing.Source§fn harness_api(&self) -> u32
fn harness_api(&self) -> u32
Contract version, checked by
Harness::build.Source§fn emits(&self) -> &'static [&'static str]
fn emits(&self) -> &'static [&'static str]
Event names this module emits (
"<module>.<event>"), listed by
/__health.Source§fn public_writes(&self) -> bool
fn public_writes(&self) -> bool
Whether the module has public write endpoints; drives the
production-captcha rule (section 11).
Source§fn well_known(&self) -> Option<Router>
fn well_known(&self) -> Option<Router>
Routes this module serves at the root under
/.well-known, for
spec-mandated discovery documents (OIDC openid-configuration,
jwks.json) that must live outside /v1 (issue #46). Paths are
relative to the prefix: register /jwks.json, not
/.well-known/jwks.json. Read moreAuto Trait Implementations§
impl Freeze for Cms
impl RefUnwindSafe for Cms
impl Send for Cms
impl Sync for Cms
impl Unpin for Cms
impl UnsafeUnpin for Cms
impl UnwindSafe for Cms
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more