Skip to main content

Answers

Trait Answers 

Source
pub trait Answers {
    // Required methods
    fn reading(&self, resource: &str) -> Option<Value>;
    fn submit(&self, ask: &Ask) -> Result<(), String>;
}
Expand description

What answers a Connection: the session’s door, or a host that runs the app inside itself in a test or a capture.

Required Methods§

Source

fn reading(&self, resource: &str) -> Option<Value>

The reading of resource now, as the host publishes it: the state a view reads, never a document. None when nothing publishes it, or the caller may not read it (denial is absence, §6).

Source

fn submit(&self, ask: &Ask) -> Result<(), String>

Submit ask, answering the door’s verdict.

§Errors

The door’s refusal, in its own words (§4, §6).

Implementors§