Skip to main content

HostTextMeasurer

Trait HostTextMeasurer 

Source
pub trait HostTextMeasurer: Send + Sync {
    // Required method
    fn measure(
        &self,
        request: HostTextMeasurementRequest<'_>,
    ) -> HostMeasurementResult;

    // Provided method
    fn measure_with_control(
        &self,
        request: HostTextMeasurementRequest<'_>,
        _control: &OperationControl,
    ) -> HostMeasurementResult { ... }
}
Expand description

Fallible, operation-aware host counterpart of TextMeasurer.

Returning Ok(None) declines exactly the requested operation. Returning a result variant that does not match request.operation, or an invalid value, uses the configured fallback and is recorded as HostFallbackReason::Invalid.

Required Methods§

Provided Methods§

Source

fn measure_with_control( &self, request: HostTextMeasurementRequest<'_>, _control: &OperationControl, ) -> HostMeasurementResult

Measures within the active render operation. Existing host adapters may ignore control; native adapters use it to checkpoint bounded shaping and wrapping work.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§