Skip to main content

Selector

Enum Selector 

Source
pub enum Selector {
Show 19 variants Document, Page(u32), Object(u32), Stream(u32), Revision(u32), Member(u32), PackagePart(String), Relationship(String), ByteRange { offset: u64, len: u64, }, TextMatch(String), Metadata, Text, Heading(u32), Block(u32), Table(u32), Cell { table: u32, row: u32, col: u32, }, Resource(u32), Link(u32), SearchMatch(String),
}
Expand description

A typed observation selector.

Variants§

§

Document

The whole document.

§

Page(u32)

A page, by 1-based page number (as recovered by ingest).

§

Object(u32)

An indirect object, by object number.

§

Stream(u32)

An encoded stream, by owning object number.

§

Revision(u32)

A physical revision, by 0-based index.

§

Member(u32)

A package (ZIP/OCF/OPC) member, by central-directory ordinal. The ordinal is the physical identity; duplicate names stay distinct (Phase 12.2).

§

PackagePart(String)

A generic OPC package part, by absolute part name (Phase 12.3). Part-name equivalence is case-insensitive. Resolution is by the OPC relationship graph, never by a hardcoded path.

§

Relationship(String)

A generic OPC relationship, by id (Phase 12.3). Ids are only unique within one .rels part, so a duplicated id across owners is a typed ambiguity decline.

§

ByteRange

A half-open exact source byte range.

Fields

§offset: u64

Start offset.

§len: u64

Length in bytes.

§

TextMatch(String)

Every text line containing a pattern (case-sensitive).

§

Metadata

Common document-level metadata projection (format-neutral). Only the detected format’s native metadata is projected; the answer names the format and its native provenance (Phase 12.7, ADR-0031).

§

Text

Common whole-document reading-text projection.

§

Heading(u32)

Common the n-th heading in reading order (0-based).

§

Block(u32)

Common the n-th block (paragraph or table) in reading order (0-based).

§

Table(u32)

Common the n-th top-level table in reading order (0-based).

§

Cell

Common a table cell by 0-based table, row, and physical grid col.

Fields

§table: u32

0-based table index in reading order.

§row: u32

0-based row index.

§col: u32

0-based physical column index (a DOCX grid column; an EPUB cell position).

§

Resource(u32)

Common the n-th embedded resource (image/embedded object) in reading order (0-based).

Common the n-th hyperlink in reading order (0-based).

§

SearchMatch(String)

Common a deterministic, case-sensitive lexical search over the document’s reading text. Never an embedding or a model call.

Implementations§

Source§

impl Selector

Source

pub fn canonical(&self) -> String

Canonical selector text, e.g. page:1 or byte-range:10:4.

Source

pub fn is_common(&self) -> bool

Whether this selector belongs to the format-neutral common vocabulary (Phase 12.7). Common selectors dispatch through the detected format’s adapter; native selectors are first-class peers, never fallbacks.

Trait Implementations§

Source§

impl Clone for Selector

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Selector

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Selector

Source§

impl PartialEq for Selector

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Selector

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.