Core Library0.xAPI reference

Choose documentation 1

pr-173

Current version

pr-173
English

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

MoreLess about this notice

struct libtmux-elixir

Selection

An ordered, materialized Enumerable over one captured entity type.

Source and package
Qualified name
LibTmux.Selection
Module
LibTmux
Package
libtmux
Source
lib/libtmux/selection.ex
struct LibTmux.Selection

Description

Enumeration never refreshes or performs I/O. where/2 accepts predicate data; filter/2 accepts unary Elixir functions with Enum truthiness. Holding a selection retains its snapshot graph. Enum.to_list/1 projects ordinary values when graph context is no longer needed.

Members13 members

Common operations6

  • count/2 function Counts observed matching items; use size/1 for cached unfiltered size.
  • one/2 function Returns exactly one match, or a structured cardinality error; stops at the second match.
  • member_id?/2 function Checks native identity separately from Enumerable element membership.
  • one_or_nil/2 function Returns one match or nil; a second match remains an error.
  • one!/2 function Returns exactly one match or raises its cardinality error.
  • where/2 function Filters validated data while retaining order and captured graph context.

Other members7

  • exists?/2 function Returns true on the first matching observed item.
  • filter/2 function Filters with a unary local function; normal predicate exceptions propagate.
  • new/2 function Materializes the observed items of an entity without I/O.
  • one_or_nil!/2 function Returns one match or nil, raising on multiple matches.
  • size/1 function Returns cached materialized size in constant time.
  • t/0: t() :: t(LibTmux.Schema.observation()) typealias A selection without a concrete observation type; use t:t/1 to preserve item types.
  • t/1 typealias An ordered selection retaining items of one observation type and their originating snapshot.

Guides

task material

Pages that discuss Selection.

Esc
Search in

Type to search.

Reference previewOpen reference