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.

function libtmux-elixir latest

Ref.from_observation/1

Builds a reference from an observation's own identity and server instance.

Source and package
Qualified name
LibTmux.Ref.from_observation/1
Module
LibTmux
Declared in
Ref
Package
libtmux
Source
lib/libtmux/ref.ex
from_observation(arg1) @spec from_observation(LibTmux.Schema.observation()) :: {:ok, t()} | {:error, LibTmux.Error.t()}

Description#

Validates the identity with new/3 without I/O or a fresh observation. Malformed identities and other inputs return an :invalid_target error. Other captured fields may remain unloaded or unavailable. A reference does not prove that its target still exists. Window links retain their tuple binding and lifetime limitation; domain actions reject window-link refs.

Examples#

iex> pane = %LibTmux.Pane{id: "%7", server_instance: "instance-a"}
iex> {:ok, ref} = LibTmux.Ref.from_observation(pane)
iex> {ref.entity, ref.id, ref.server_instance}
{:pane, "%7", "instance-a"}

Discussed in Getting started

Esc

Type to search.

Reference preview Open reference