Core LibraryalphaAPI Reference

Choose documentation 1

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

struct libtmux-elixir latest

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.

Discussed in Read values, execute explicitly

Members13#

Common operations7#

  • count/2 function Counts observed matching items; use size/1 for cached unfiltered size.
  • filter/2 function Filters with a unary local function; normal predicate exceptions propagate.
  • 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.
  • member_id?/2 function Checks native identity separately from Enumerable element membership.
  • one/2 function Returns exactly one match, or a structured cardinality error; stops at the second match.
  • one_or_nil/2 function Returns one match or nil; a second match remains an error.

Other members6#

  • exists?/2 function Returns true on the first matching observed item.
  • 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.
Esc

Type to search.

Reference preview Open reference