pub enum RelayoutError {
NoLayout,
ScaleDirty,
UnknownBlock(usize),
}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.
UnknownBlock(usize)
params.block_id is not in this flow’s layout — not a top-level block,
not in any table cell, not in any frame.
Reported rather than ignored because ignoring it is worse than it looks:
the incremental path exists to relayout the block AND shift the
document-character positions of everything after it, so doing nothing
leaves the flow holding pre-edit text and pre-edit positions while the
document has moved on. Hit-testing and selection painting then disagree
with the document by the edit’s length, for every block after it, until
something forces a full layout. The caller’s recovery is to run
DocumentFlow::layout_full.
Trait Implementations§
Source§impl Clone for RelayoutError
impl Clone for RelayoutError
Source§fn clone(&self) -> RelayoutError
fn clone(&self) -> RelayoutError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RelayoutError
Source§impl Debug for RelayoutError
impl Debug for RelayoutError
Source§impl Display for RelayoutError
impl Display for RelayoutError
impl Eq 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()
Source§impl PartialEq for RelayoutError
impl PartialEq for RelayoutError
impl StructuralPartialEq for RelayoutError
Auto Trait Implementations§
impl Freeze for RelayoutError
impl RefUnwindSafe for RelayoutError
impl Send for RelayoutError
impl Sync for RelayoutError
impl Unpin for RelayoutError
impl UnsafeUnpin for RelayoutError
impl UnwindSafe for RelayoutError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.