#[non_exhaustive]pub enum ResourceLocator {
Text {
byte_start: u64,
byte_end: u64,
line_start: Option<u64>,
line_end: Option<u64>,
},
PageText {
page: u32,
byte_start: u64,
byte_end: u64,
text_version: String,
page_text_hash: String,
},
Page {
page: u32,
},
Time {
start_ms: u64,
end_ms: u64,
},
ImageRegion {
x: u32,
y: u32,
width: u32,
height: u32,
},
WholeResource,
}Expand description
Where inside a resource a hit was found. Deliberately modality-independent.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Text
A byte range of a text resource. Lines are 1-based and inclusive.
PageText
UTF-8 range within deterministic extracted text of a 1-based physical page.
Page
A page of a paged document (reserved for PDF and similar).
Time
A time window of an audio or video resource.
ImageRegion
Rectangle in original-image pixels. Origin is top-left; x grows right, y grows down. Reserved: no current provider produces this locator.
WholeResource
The resource as a whole, for example a single image.
Implementations§
Trait Implementations§
Source§impl Clone for ResourceLocator
impl Clone for ResourceLocator
Source§impl Debug for ResourceLocator
impl Debug for ResourceLocator
Source§impl<'de> Deserialize<'de> for ResourceLocator
impl<'de> Deserialize<'de> for ResourceLocator
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ResourceLocator
Source§impl PartialEq for ResourceLocator
impl PartialEq for ResourceLocator
Source§impl Serialize for ResourceLocator
impl Serialize for ResourceLocator
impl StructuralPartialEq for ResourceLocator
Auto Trait Implementations§
impl Freeze for ResourceLocator
impl RefUnwindSafe for ResourceLocator
impl Send for ResourceLocator
impl Sync for ResourceLocator
impl Unpin for ResourceLocator
impl UnsafeUnpin for ResourceLocator
impl UnwindSafe for ResourceLocator
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.