pub struct DocumentLines {
pub text: String,
pub lines: Option<LineRange>,
pub total_lines: u64,
}Expand description
A document’s text as a read serves it: whole, or some of its lines
(lines=, 0.118.0). The one copy of how a document’s lines are counted
and cut, for the server’s reads and the seed runner’s outline alike: a
line is what ends at a \n, or the text’s end, numbered from 1
(LineRange::span)
Fields§
§text: StringThe text, or the lines of it asked for
lines: Option<LineRange>The lines text holds, for a read of some: the range asked for,
its end clamped to the last line
total_lines: u64The whole text’s lines
Implementations§
Source§impl DocumentLines
impl DocumentLines
Sourcepub fn select(
name: &str,
text: &str,
lines: Option<LineRange>,
) -> Result<Self, DocumentPastEnd>
pub fn select( name: &str, text: &str, lines: Option<LineRange>, ) -> Result<Self, DocumentPastEnd>
text whole, or with lines those lines of it. A document has no
byte budget: its largest is a few tens of KB, which a read of it
whole shows anyway. A range that starts past the last line is
refused, naming the document as name
Trait Implementations§
Source§impl Clone for DocumentLines
impl Clone for DocumentLines
Source§impl Debug for DocumentLines
impl Debug for DocumentLines
impl Eq for DocumentLines
Source§impl PartialEq for DocumentLines
impl PartialEq for DocumentLines
impl StructuralPartialEq for DocumentLines
Auto Trait Implementations§
impl Freeze for DocumentLines
impl RefUnwindSafe for DocumentLines
impl Send for DocumentLines
impl Sync for DocumentLines
impl Unpin for DocumentLines
impl UnsafeUnpin for DocumentLines
impl UnwindSafe for DocumentLines
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.