LineIndex
struct · ferroui-designer-language · v0.5.0
struct LineIndex
UTF-16 LSP positions over UTF-8 authored bytes, retaining LF/CRLF/CR exactly.
Members
new
fn new(source: &str) -> Self
source
fn source(self: &Self) -> &str
line_count
fn line_count(self: &Self) -> usize
offset
fn offset(self: &Self, position: Position) -> Result<usize>
position
fn position(self: &Self, offset: usize) -> Result<Position>
span
fn span(self: &Self, range: Range) -> Result<SourceSpan>
range
fn range(self: &Self, span: SourceSpan) -> Result<Range>
apply
fn apply(self: &mut Self, change: &TextChange) -> Result<()>
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedCloneDebug
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.