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> { ... }
fn host_box(&self, _request: HostBoxRequest) -> Option<HostBox> { ... }
}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.
Sourcefn host_box(&self, _request: HostBoxRequest) -> Option<HostBox>
fn host_box(&self, _request: HostBoxRequest) -> Option<HostBox>
Returns the box for a host owned token, or None to typeset a zero size box.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".