pub enum RelayoutError {
NoLayout,
ScaleDirty,
}Expand description
Reasons DocumentFlow::relayout_block may refuse an
incremental update.
Both variants describe invariant violations the caller can
detect structurally ahead of time by asking
DocumentFlow::has_layout and
DocumentFlow::layout_dirty_for_scale. Returned as a
Result rather than panicking so a misbehaving caller
produces a recoverable error at the exact call site instead
of corrupting the flow with a partial relayout.
Variants§
NoLayout
No layout_* method has been called on this flow yet.
The caller must run DocumentFlow::layout_full or
DocumentFlow::layout_blocks first to establish a
baseline layout before incremental updates make sense.
ScaleDirty
The backing TextFontService has had its HiDPI scale
factor changed since this flow was last laid out, so the
existing block layouts hold advances at the old ppem.
Re-shaping a single block would leave it at the new ppem
while neighbors stay at the old, producing an inconsistent
flow. The caller must re-run layout_full /
layout_blocks to rebuild everything at the new scale.
Trait Implementations§
Source§impl Clone for RelayoutError
impl Clone for RelayoutError
Source§fn clone(&self) -> RelayoutError
fn clone(&self) -> RelayoutError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RelayoutError
impl Debug for RelayoutError
Source§impl Display for RelayoutError
impl Display for RelayoutError
Source§impl Error for RelayoutError
impl Error for RelayoutError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()