Struct stam::ResultTextSelectionSet

source ·
pub struct ResultTextSelectionSet<'store> { /* private fields */ }
Expand description

A TextSelectionSet holds one or more TextSelection items and a reference to the TextResource from which they’re drawn. This structure encapsulates such a TextSelectionSet and contains a reference to the underlying AnnotationStore.

Implementations§

source§

impl<'store> ResultTextSelectionSet<'store>

source

pub fn rootstore(&self) -> &'store AnnotationStore

source

pub fn resource(&self) -> ResultItem<'store, TextResource>

source

pub fn related_text( self, operator: TextSelectionOperator ) -> impl Iterator<Item = ResultTextSelection<'store>>

Applies a TextSelectionOperator to find all other text selections that are in a specific relation with the current text selection set. Returns an iterator over the TextSelection instances. (as ResultItem<TextSelection>). If you are interested in the annotations associated with the found text selections, then use [Self::find_annotations()] instead.

source

pub fn test( &self, operator: &TextSelectionOperator, other: &ResultTextSelection<'_> ) -> bool

Compares whether a particular spatial relation holds between two text selections

source

pub fn test_set( &self, operator: &TextSelectionOperator, other: &ResultTextSelectionSet<'_> ) -> bool

Compares whether a particular spatial relation holds between this text selections and a set of others

source§

impl<'store> ResultTextSelectionSet<'store>

source

pub fn inner(&self) -> &TextSelectionSet

source

pub fn len(&self) -> usize

source

pub fn iter<'a>( &'a self ) -> impl Iterator<Item = ResultTextSelection<'store>> + 'a

Trait Implementations§

source§

impl<'store> From<ResultTextSelectionSet<'store>> for TextSelectionSet

source§

fn from(other: ResultTextSelectionSet<'store>) -> Self

Converts to this type from the input type.
source§

impl<'store> FromIterator<ResultTextSelection<'store>> for ResultTextSelectionSet<'store>

source§

fn from_iter<T: IntoIterator<Item = ResultTextSelection<'store>>>( iter: T ) -> Self

Creates a value from an iterator. Read more
source§

impl<'store> PartialEq for ResultTextSelectionSet<'store>

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'store> PartialOrd for ResultTextSelectionSet<'store>

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<'store> Transposable<'store> for ResultTextSelectionSet<'store>

source§

fn transpose( &self, via: &ResultItem<'store, Annotation>, config: TransposeConfig ) -> Result<Vec<AnnotationBuilder<'static>>, StamError>

The transpose function maps an annotation, textselection, or textselection set from one coordinate system to another. These mappings are defined in annotations called transpositions and are documented here: https://github.com/annotation/stam/blob/master/extensions/stam-transpose/README.md Transpositions link identical textual parts across resources, any annotations within the bounds of such a mapping can then be transposed using this function to the other coordinate system. Read more
source§

impl<'store> TryFrom<&ResultItem<'store, Annotation>> for ResultTextSelectionSet<'store>

§

type Error = StamError

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

fn try_from( annotation: &ResultItem<'store, Annotation> ) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<'store> Freeze for ResultTextSelectionSet<'store>

§

impl<'store> RefUnwindSafe for ResultTextSelectionSet<'store>

§

impl<'store> Send for ResultTextSelectionSet<'store>

§

impl<'store> Sync for ResultTextSelectionSet<'store>

§

impl<'store> Unpin for ResultTextSelectionSet<'store>

§

impl<'store> UnwindSafe for ResultTextSelectionSet<'store>

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> 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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<'store, I> SortTextualOrder<ResultTextSelectionSet<'store>> for I
where I: Iterator<Item = ResultTextSelectionSet<'store>>,

source§

fn textual_order(&mut self) -> Vec<ResultTextSelectionSet<'store>>

Sorts items in the iterator in textual order, meaningthat items are returned in the same order as they appear in the original text. items that do not relate to text at all will be put at the end with arbitrary sorting This method allocates and returns a buffer to do the sorting. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
source§

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

source§

fn vzip(self) -> V