Skip to main content

Locator

Struct Locator 

Source
pub struct Locator { /* private fields */ }
Expand description

A lazy query resolved against the current terminal grid before every read, wait, or action.

Implementations§

Source§

impl Locator

Source

pub fn query(&self) -> &LocatorQuery

Source

pub fn and(&self, other: &Self) -> Result<Self, TuiTestError>

Intersect selected cells and form contiguous per-row runs.

Source

pub fn or(&self, other: &Self) -> Result<Self, TuiTestError>

Union selected cells and form contiguous per-row runs.

Source

pub fn filter( &self, options: LocatorFilterOptions, ) -> Result<Self, TuiTestError>

Require every cell of each current match to have this link.

Source

pub fn get_by_text(&self, selector: impl Into<TextSelector>) -> Self

Source

pub fn get_by_text_relative( &self, selector: impl Into<TextSelector>, direction: LocatorDirection, ) -> Self

Source

pub fn get_by_style(&self, selector: impl Into<StyleSelector>) -> Self

Source

pub fn get_by_style_relative( &self, selector: impl Into<StyleSelector>, direction: LocatorDirection, ) -> Self

Source

pub fn any(&self) -> Self

Source

pub fn unique(&self) -> Self

Source

pub fn first(&self) -> Self

Source

pub fn last(&self) -> Self

Source

pub fn nth(&self, index: usize) -> Self

Source

pub fn all(&self) -> Result<Vec<Self>, TuiTestError>

Source

pub fn count(&self) -> Result<usize, TuiTestError>

Source

pub fn locations(&self) -> Result<Vec<TextMatch>, TuiTestError>

Source

pub fn location(&self) -> Result<TextMatch, TuiTestError>

Source

pub fn wait(&self) -> Result<(), TuiTestError>

Source

pub fn wait_with_timeout( &self, timeout_ms: Option<u64>, ) -> Result<(), TuiTestError>

Source

pub fn wait_hidden(&self, timeout_ms: Option<u64>) -> Result<(), TuiTestError>

Source

pub fn click(&self) -> Result<(), TuiTestError>

Source

pub fn click_with( &self, options: LocatorClickOptions, ) -> Result<(), TuiTestError>

Source

pub fn highlight(&self) -> Result<(), TuiTestError>

Source

pub fn highlight_with_timeout( &self, timeout_ms: Option<u64>, ) -> Result<(), TuiTestError>

Source

pub fn expect(&self) -> Result<(), TuiTestError>

Source

pub fn expect_with( &self, options: LocatorExpectOptions, ) -> Result<(), TuiTestError>

Trait Implementations§

Source§

impl Clone for Locator

Source§

fn clone(&self) -> Locator

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

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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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.