[][src]Struct folia::select::Selector

pub struct Selector {
    pub action: Action,
    pub datatypes: Vec<DataTypeSelector>,
    pub elementtype: Cmp<ElementType>,
    pub elementgroup: Cmp<ElementGroup>,
    pub contexttype: Cmp<ElementType>,
    pub set: Cmp<DecKey>,
    pub class: Cmp<ClassKey>,
    pub processor: Cmp<ProcKey>,
    pub subset: Cmp<SubsetKey>,
    pub confidence: Cmp<f64>,
    pub annotator: Cmp<String>,
    pub annotatortype: Cmp<ProcessorType>,
    pub next: Option<Box<Selector>>,
}

The selector defines matching criteria for a SelectIterator It is constructed from a Query given a document, i.e. it is the encoded form of a query.

Fields

action: Actiondatatypes: Vec<DataTypeSelector>elementtype: Cmp<ElementType>elementgroup: Cmp<ElementGroup>contexttype: Cmp<ElementType>set: Cmp<DecKey>class: Cmp<ClassKey>processor: Cmp<ProcKey>subset: Cmp<SubsetKey>confidence: Cmp<f64>annotator: Cmp<String>annotatortype: Cmp<ProcessorType>next: Option<Box<Selector>>

Implementations

impl Selector[src]

pub fn from_query(
    document: &Document,
    query: &Query
) -> Result<Self, FoliaError>
[src]

Builds a new selector given a query and a document (effectively encoding the query into a selector for the specified document)

pub fn with_elements(self) -> Self[src]

Sets the selector to also yield Folia Elements (you usually don't need this as it's the default or already implied in Selector construction)

pub fn with_text(self) -> Self[src]

Sets the selector to also yield XML text

pub fn with_comments(self) -> Self[src]

Sets the selector to also yield XML comments

pub fn element(self, value: Cmp<ElementType>) -> Self[src]

Constrains the selector by element type

pub fn elements() -> Self[src]

Creates a selector on elements

pub fn all_data() -> Self[src]

Creates a selector on all data (alias for Selector::default())

pub fn elementgroup(self, value: Cmp<ElementGroup>) -> Self[src]

Constrains the selector by element group

pub fn and(self, selector: Selector) -> Self[src]

Add another selector, the resulting selection will then consist of the union of the selectors. This can be chained multiple times.

pub fn matchable(&self) -> bool[src]

The selector determines whether it is matchable in the encoding stage, when references are made to sets or classes that don't exist in the document, then it is unmatchable and there is no sense in actually performing any matching.

pub fn matches(&self, document: &Document, item: &DataType) -> bool[src]

Tests if the selector matches against the specified data item, given an element store. There is no need to invoke this directly if you use a SelectIterator.

Trait Implementations

impl Clone for Selector[src]

impl Default for Selector[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,