pub trait SurfaceCodec: Send + Sync {
// Required methods
fn encode(
&self,
cx: &mut Cx,
value: &Expr,
caps: &SurfaceCaps,
) -> Result<Expr>;
fn decode(&self, cx: &mut Cx, value: &Expr, intent: &Expr) -> Result<Draft>;
fn commit(&self, cx: &mut Cx, draft: &Draft) -> Result<Operation>;
}Expand description
Required Methods§
Sourcefn encode(&self, cx: &mut Cx, value: &Expr, caps: &SurfaceCaps) -> Result<Expr>
fn encode(&self, cx: &mut Cx, value: &Expr, caps: &SurfaceCaps) -> Result<Expr>
Renders value to a Scene projected for caps (deterministic).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".