pub struct Excerpt {
pub id: ExcerptId,
pub source: BufferId,
pub start_line: u32,
pub end_line: u32,
pub header: ExcerptHeader,
}Expand description
One excerpt of a source document, identified by its source
BufferId and an inclusive line range
[start_line, end_line].
M.1 keeps the range as integer line numbers; M.4 swaps to
Anchor-based positions that slide on source edits.
Fields§
§id: ExcerptId§source: BufferId§start_line: u32§end_line: u32§header: ExcerptHeaderImplementations§
Source§impl Excerpt
impl Excerpt
pub fn new(source: BufferId, start_line: u32, end_line: u32) -> Self
pub fn with_header(self, header: ExcerptHeader) -> Self
Sourcepub fn line_count(&self) -> u32
pub fn line_count(&self) -> u32
Number of source rows this excerpt covers. Always >= 1
for a well-formed excerpt.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Excerpt
impl RefUnwindSafe for Excerpt
impl Send for Excerpt
impl Sync for Excerpt
impl Unpin for Excerpt
impl UnsafeUnpin for Excerpt
impl UnwindSafe for Excerpt
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more