Skip to main content

Render

Trait Render 

Source
pub trait Render {
    // Required method
    fn render(&self, args: Args) -> String;
}
Expand description

Render an API result as one of several OutputFormats.

Required Methods§

Source

fn render(&self, args: Args) -> String

Render an API result as one of several OutputFormats.

The compact parameter truncates the rendering to a single line:

  • When there are multiple results, it picks a single one.
  • When the main output contains linebreaks, trim and replace them with spaces.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Render for Answer

Source§

fn render(&self, args: Args) -> String

Implementors§