Skip to main content

Interlocutor

Trait Interlocutor 

Source
pub trait Interlocutor {
    // Required methods
    fn approve(&mut self, request: &ApprovalRequest) -> bool;
    fn consult(
        &mut self,
        request: &ConsultRequest,
    ) -> Result<String, ConsultError>;
}
Expand description

A person, from the run’s side of the channel.

Required Methods§

Source

fn approve(&mut self, request: &ApprovalRequest) -> bool

Whether a gated action may proceed.

Source

fn consult(&mut self, request: &ConsultRequest) -> Result<String, ConsultError>

Put a question to a person and return what they said.

Fallible where Interlocutor::approve is not, and the difference is real rather than stylistic: a gate that cannot reach anybody has a safe answer, and a question does not. Refusing to guess is the only thing left, so this reports why instead.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§