pub(crate) struct Document {
pub file: FileId,
text: String,
line_starts: Vec<usize>,
pub parsed: Parsed,
}Fields§
§file: FileId§text: String§line_starts: Vec<usize>The byte offset where each line starts; the first is always 0.
parsed: ParsedImplementations§
Source§impl Document
impl Document
pub(crate) fn new(text: String, file: FileId) -> Self
pub(crate) fn source(&self) -> &str
Sourcepub(crate) fn word_start(&self, offset: usize) -> usize
pub(crate) fn word_start(&self, offset: usize) -> usize
Where the name ending at offset starts; offset itself when there is none.
pub(crate) fn range(&self, span: Span, encoding: Encoding) -> Range
pub(crate) fn position(&self, offset: usize, encoding: Encoding) -> Position
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnsafeUnpin for Document
impl UnwindSafe for Document
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