pub enum FormatRunError {
ReversedRange {
start: u32,
end: u32,
},
ReplacementOutsideRange {
run_start: u32,
run_end: u32,
range_start: u32,
range_end: u32,
},
EmptyRun {
start: u32,
end: u32,
},
RunsOverlap {
index: usize,
left: Box<FormatRun>,
right: Box<FormatRun>,
},
RunsNotCoalesced {
index: usize,
},
RunPastEndOfBlock {
start: u32,
end: u32,
text_len: usize,
},
}Expand description
A violation of the format-run invariants, reported instead of asserted.
The invariants used to be guarded only by debug_assert!, which is compiled out
of release builds — so a contract violation silently produced a malformed run list
in a shipped binary, and (with autosave) that corruption became the file’s new truth
within seconds. Anything on the replace path returns this instead, so the use case
can refuse the edit and say why rather than quietly mangle a writer’s formatting.
Variants§
Trait Implementations§
Source§impl Clone for FormatRunError
impl Clone for FormatRunError
Source§fn clone(&self) -> FormatRunError
fn clone(&self) -> FormatRunError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FormatRunError
impl Debug for FormatRunError
Source§impl Display for FormatRunError
impl Display for FormatRunError
impl Eq for FormatRunError
Source§impl Error for FormatRunError
impl Error for FormatRunError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for FormatRunError
impl PartialEq for FormatRunError
impl StructuralPartialEq for FormatRunError
Auto Trait Implementations§
impl Freeze for FormatRunError
impl RefUnwindSafe for FormatRunError
impl Send for FormatRunError
impl Sync for FormatRunError
impl Unpin for FormatRunError
impl UnsafeUnpin for FormatRunError
impl UnwindSafe for FormatRunError
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
Mutably borrows from an owned value. Read more