Skip to main content

Destination

Trait Destination 

Source
pub trait Destination {
    // Required methods
    fn write(&mut self, payload: Payload) -> Result<(), String>;
    fn describe(&self) -> &'static str;

    // Provided method
    fn accepts(&self) -> Accepts { ... }
}
Expand description

Somewhere a payload can go. A trait so the integration tests can hand the app a destination that only records what it was given.

Required Methods§

Source

fn write(&mut self, payload: Payload) -> Result<(), String>

Takes the payload: a destination that keeps it owns it, without a copy.

Source

fn describe(&self) -> &'static str

One word for the flash and for errors: “clipboard” or “terminal”.

Provided Methods§

Source

fn accepts(&self) -> Accepts

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§