Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

trait libtmux-rs latest

QueryIteratorExt

Cardinality and named-predicate operations for native iterators.

Source and package
Qualified name
libtmux::query::QueryIteratorExt
Module
query
Package
libtmux
Source
crates/libtmux/src/query.rs
trait query.QueryIteratorExt

Description#

Self::matching() borrows candidates from a borrowed iterator; Self::matching_owned() moves each selected item from its iterator. Cardinality methods preserve the iterator's item type in either case.

Examples#

use libtmux::query::QueryIteratorExt;
let values = [1, 2, 3];
assert_eq!(values.iter().exactly_one(), Err(libtmux::query::ExactlyOneError::MultipleItems));

Members4#

  • exactly_one method Return the only item, or an error for zero or multiple items.
  • matching method Lazily yield candidates accepted by matcher.
  • one_or_none method Return zero or one item, or an error for multiple items.
  • matching_owned method Lazily move items accepted by matcher, without cloning them.
Esc

Type to search.

Reference previewOpen reference