Struct stam::TextSelectionSet
source · pub struct TextSelectionSet { /* private fields */ }Expand description
A TextSelectionSet holds one or more TextSelection items and a reference to the TextResource from which they’re drawn.
All textselections in a set must reference the same resource, which implies they are comparable.
Implementations§
source§impl TextSelectionSet
impl TextSelectionSet
pub fn new(resource: TextResourceHandle) -> Self
pub fn as_resultset(self, store: &AnnotationStore) -> ResultTextSelectionSet<'_>
pub fn add(&mut self, textselection: TextSelection) -> &mut Self
sourcepub fn iter<'a>(&'a self) -> TextSelectionSetIter<'a> ⓘ
pub fn iter<'a>(&'a self) -> TextSelectionSetIter<'a> ⓘ
Iterate over the text selections
pub fn has_handle(&self, handle: TextSelectionHandle) -> bool
pub fn get(&self, index: usize) -> Option<&TextSelection>
pub fn len(&self) -> usize
pub fn resource(&self) -> TextResourceHandle
pub fn is_empty(&self) -> bool
pub fn begin(&self) -> Option<usize>
pub fn end(&self) -> Option<usize>
sourcepub fn leftmost(&self) -> Option<&TextSelection>
pub fn leftmost(&self) -> Option<&TextSelection>
Returns the left-most TextSelection (the one with the lowest start offset) in the set.
sourcepub fn rightmost(&self) -> Option<&TextSelection>
pub fn rightmost(&self) -> Option<&TextSelection>
Returns the right-most TextSelection (the one with the highest end offset) in the set.
Trait Implementations§
source§impl Clone for TextSelectionSet
impl Clone for TextSelectionSet
source§fn clone(&self) -> TextSelectionSet
fn clone(&self) -> TextSelectionSet
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for TextSelectionSet
impl Debug for TextSelectionSet
source§impl Extend<TextSelection> for TextSelectionSet
impl Extend<TextSelection> for TextSelectionSet
source§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = TextSelection>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = TextSelection>,
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)source§impl<'store> From<ResultItem<'store, TextSelection>> for TextSelectionSet
impl<'store> From<ResultItem<'store, TextSelection>> for TextSelectionSet
source§fn from(textselection: ResultItem<'store, TextSelection>) -> Self
fn from(textselection: ResultItem<'store, TextSelection>) -> Self
source§impl<'store> From<ResultTextSelection<'store>> for TextSelectionSet
impl<'store> From<ResultTextSelection<'store>> for TextSelectionSet
source§fn from(textselection: ResultTextSelection<'store>) -> Self
fn from(textselection: ResultTextSelection<'store>) -> Self
source§impl<'store> From<ResultTextSelectionSet<'store>> for TextSelectionSet
impl<'store> From<ResultTextSelectionSet<'store>> for TextSelectionSet
source§fn from(other: ResultTextSelectionSet<'store>) -> Self
fn from(other: ResultTextSelectionSet<'store>) -> Self
source§impl<'store> FromIterator<ResultItem<'store, TextSelection>> for TextSelectionSet
impl<'store> FromIterator<ResultItem<'store, TextSelection>> for TextSelectionSet
source§fn from_iter<T: IntoIterator<Item = ResultItem<'store, TextSelection>>>(
iter: T
) -> Self
fn from_iter<T: IntoIterator<Item = ResultItem<'store, TextSelection>>>( iter: T ) -> Self
source§impl<'store> FromIterator<ResultTextSelection<'store>> for TextSelectionSet
impl<'store> FromIterator<ResultTextSelection<'store>> for TextSelectionSet
source§fn from_iter<T: IntoIterator<Item = ResultTextSelection<'store>>>(
iter: T
) -> Self
fn from_iter<T: IntoIterator<Item = ResultTextSelection<'store>>>( iter: T ) -> Self
source§impl IntoIterator for TextSelectionSet
impl IntoIterator for TextSelectionSet
source§impl PartialEq for TextSelectionSet
impl PartialEq for TextSelectionSet
source§fn eq(&self, other: &TextSelectionSet) -> bool
fn eq(&self, other: &TextSelectionSet) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd for TextSelectionSet
impl PartialOrd for TextSelectionSet
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl TestTextSelection for TextSelectionSet
impl TestTextSelection for TextSelectionSet
source§fn test(
&self,
operator: &TextSelectionOperator,
reftextsel: &TextSelection,
resource: &TextResource
) -> bool
fn test( &self, operator: &TextSelectionOperator, reftextsel: &TextSelection, resource: &TextResource ) -> bool
This method is called to test whether a specific spatial relation (as expressed by the passed operator) holds between two TextSelectionSets.
A boolean is returned with the test result.
source§fn test_set(
&self,
operator: &TextSelectionOperator,
refset: &TextSelectionSet,
resource: &TextResource
) -> bool
fn test_set( &self, operator: &TextSelectionOperator, refset: &TextSelectionSet, resource: &TextResource ) -> bool
This method is called to test whether a specific spatial relation (as expressed by the passed operator) holds between two TextSelectionSets.
A boolean is returned with the test result.
source§impl TypeInfo for TextSelectionSet
impl TypeInfo for TextSelectionSet
impl StructuralPartialEq for TextSelectionSet
Auto Trait Implementations§
impl Freeze for TextSelectionSet
impl RefUnwindSafe for TextSelectionSet
impl Send for TextSelectionSet
impl Sync for TextSelectionSet
impl Unpin for TextSelectionSet
impl UnwindSafe for TextSelectionSet
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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