pub struct Quote {
pub exact: String,
pub prefix: String,
pub suffix: String,
pub start: usize,
pub end: usize,
}Expand description
A selection cited out of the source: the text itself, up to a requested
number of characters either side, and the byte range it came from. See
Doc::selection_quote.
The prefix and suffix are what make the quote re-findable: the same text
can occur twice, and a little of what surrounded it is how a later reader —
or the same document after an edit — tells the occurrences apart. The Web
Annotation model calls this a TextQuoteSelector; the shape is older than
the name.
Fields§
§exact: StringThe selected source, verbatim.
prefix: StringWhat immediately preceded it — possibly empty, at the document’s start.
suffix: StringWhat immediately followed it — possibly empty, at the document’s end.
start: usizeByte offset in the source where the selection begins.
end: usizeByte offset where it ends (exclusive).
Trait Implementations§
impl Eq for Quote
impl StructuralPartialEq for Quote
Auto Trait Implementations§
impl Freeze for Quote
impl RefUnwindSafe for Quote
impl Send for Quote
impl Sync for Quote
impl Unpin for Quote
impl UnsafeUnpin for Quote
impl UnwindSafe for Quote
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