Skip to main content

RENDER

Constant RENDER 

Source
pub const RENDER: &str = "trait Render { func render() -> Unit; }";
Expand description

A typed presentation contract with one render operation.

Querying Render implementers is language behavior. Rendering remains an adapter responsibility; declaring this trait never schedules an automatic render call.

§Declaration

trait Render { func render() -> Unit; }

§Fields and methods

  • render: Required presentation operation. A host or system chooses when to invoke it.

§Implement a render operation

The trait only checks the method contract.

type Example {}

impl Render for Example {
  func render() -> Unit { print("rendered"); }
}

let value = Example {};
value.render();