pub struct Span {
pub start_byte: usize,
pub end_byte: usize,
pub style: u32,
}Expand description
One styled byte range on a buffer row.
Style spans are opaque-id tuples. The buffer does not own colors. The
host (engine layer or terminal frontend) keeps the table mapping
style: u32 to a renderable type.
Byte ranges are half-open: [start_byte, end_byte). They line up
with the row’s String so callers can slice without re-deriving
indices.
The host installs spans via the engine’s Editor::install_syntax_spans
(or equivalent) after each edit. Spans are cleared for affected rows on
every crate::Buffer::apply_edit call and must be re-installed by the
host’s syntax pipeline.
Fields§
§start_byte: usize§end_byte: usize§style: u32Opaque style id resolved by the host’s render layer.
Implementations§
Trait Implementations§
impl Copy for Span
impl Eq for Span
impl StructuralPartialEq for Span
Auto Trait Implementations§
impl Freeze for Span
impl RefUnwindSafe for Span
impl Send for Span
impl Sync for Span
impl Unpin for Span
impl UnsafeUnpin for Span
impl UnwindSafe for Span
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