pub trait Platform {
// Required method
fn diagnostics(&self) -> &dyn DiagnosticSink;
// Provided methods
fn limits(&self) -> HostLimits { ... }
fn clock(&self) -> HostClock { ... }
fn linebreak_start(&self, _request: LinebreakRequest<'_>) { ... }
fn linebreak_next(&self) -> Option<i32> { ... }
}Expand description
Host runtime services that must remain separate from engine semantics.
Required Methods§
Sourcefn diagnostics(&self) -> &dyn DiagnosticSink
fn diagnostics(&self) -> &dyn DiagnosticSink
Returns the diagnostic sink for this platform.
Provided Methods§
Sourcefn limits(&self) -> HostLimits
fn limits(&self) -> HostLimits
Returns host resource limits, defaulting to HostLimits::default().
Sourcefn linebreak_start(&self, _request: LinebreakRequest<'_>)
fn linebreak_start(&self, _request: LinebreakRequest<'_>)
Called before the engine begins line break iteration for a paragraph.
Sourcefn linebreak_next(&self) -> Option<i32>
fn linebreak_next(&self) -> Option<i32>
Returns the next line break position, or None to use the built in algorithm.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".