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

function libtmux-elixir

Selection.one/2

Returns exactly one match, or a structured cardinality error; stops at the second match.

Source and package
Qualified name
LibTmux.Selection.one/2
Module
LibTmux
Declared in
Selection
Package
libtmux
Source
lib/libtmux/selection.ex
Type parameters
Parameters

Examples

iex> alias LibTmux.{Selection, Snapshot}
iex> {:ok, snapshot} = Snapshot.new(%{pane: [%{id: "%0"}, %{id: "%1"}]},
...> server_instance: "example", captured_from: 0, captured_until: 0,
...> fields: %{pane: [:id]})
iex> panes = Snapshot.panes(snapshot)
iex> {:ok, pane} = Selection.one(panes, id: "%1")
iex> pane.id
"%1"
iex> {:error, error} = Selection.one(panes, id: "%9")
iex> error.kind
:no_match
iex> {:error, error} = Selection.one(panes)
iex> error.kind
:multiple_matches

Recorded calls

source calls
No call edges in the Elixir model.

The Elixir reference records declarations, not calls, so this page shows no callers or callees. That is a limit of the extracted data, not a statement that nothing calls LibTmux.Selection.one/2.

Guides

task material

Pages that discuss one/2.

Esc
Search in

Type to search.

Reference previewOpen reference