pub trait Store: Send + Sync {
// Required methods
fn list(&self, page: &str) -> Result<Vec<Listed>>;
fn create(
&self,
page: &str,
anchor: Anchor,
author: &str,
text: &str,
) -> Result<String>;
fn reply(
&self,
page: &str,
id: &str,
author: &str,
text: &str,
) -> Result<()>;
fn resolve(&self, page: &str, id: &str) -> Result<()>;
}Expand description
The comment store port: where one served folder’s threads are kept. A
page is the address of the Markdown file a thread is about (/a.md);
one that climbs out of the served folder, and an id that isn’t a thread’s,
are errors. Writes are silent — announcing them is Comments’s job.
Required Methods§
Sourcefn create(
&self,
page: &str,
anchor: Anchor,
author: &str,
text: &str,
) -> Result<String>
fn create( &self, page: &str, anchor: Anchor, author: &str, text: &str, ) -> Result<String>
Starts a thread on page; answers its id.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".