| 1 | package LibTmux::Entity; | ||
| 2 | 4 | ▶ | use v5.44; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 4 | ▶ | use LibTmux::Schema; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 244 | ▶ | sub _new ($class, $store, $kind, $id) { |
|
Subroutine
_new: called CC=1 SCAR=0.0
| |||
| 6 | 244 | bless {store => $store, kind => $kind, id => $id}, $class; | |
| 7 | } | ||
| 8 | 1099 | ▶ | sub kind ($self) { $self->{kind} } |
|
Subroutine
kind: called CC=1 SCAR=0.0
Pod
documented
| |||
| 9 | 0 | ▶ | sub _store ($self) { $self->{store} } |
|
Subroutine
_store: not called CC=1 SCAR=6.9
| |||
| 10 | 552 | ▶ | sub server_id ($self) { $self->{store}->server_id } |
|
Subroutine
server_id: called CC=1 SCAR=0.0
Pod
documented
| |||
| 11 | 552 | ▶ | sub generation ($self) { $self->{store}->generation } |
|
Subroutine
generation: called CC=1 SCAR=0.0
Pod
documented
| |||
| 12 | |||
| 13 | 0 | ▶ | sub identity ($self) { |
|
Subroutine
identity: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 14 | 0 | join "\0", $self->server_id, $self->generation, $self->kind, $self->{id}; | |
| 15 | } | ||
| 16 | |||
| 17 | 246 | ▶ | sub _read ($self, $field) { |
|
Subroutine
_read: called CC=1 SCAR=0.0
| |||
| 18 | 246 | $self->{store}->_read($self->kind, $self->{id}, $field); | |
| 19 | } | ||
| 20 | |||
| 21 | 0 | ▶ | sub to_record ($self) { |
|
Subroutine
to_record: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 22 | 0 | +{$self->{store}->{records}{$self->kind}{$self->{id}}->%*}; | |
| 23 | } | ||
| 24 | |||
| 25 | =head1 NAME | ||
| 26 | |||
| 27 | LibTmux::Entity - Read-only handle retaining a captured graph | ||
| 28 | |||
| 29 | =head1 DESCRIPTION | ||
| 30 | |||
| 31 | Field readers and relationships resolve locally in the retained graph. | ||
| 32 | L</to_record> returns detached scalar record data. Handles retain no transport. | ||
| 33 | |||
| 34 | =head1 METHODS | ||
| 35 | |||
| 36 | =head2 kind | ||
| 37 | |||
| 38 | Return the schema entity-kind string. Concrete public field readers belong to L<LibTmux::Pane>, L<LibTmux::Window>, L<LibTmux::WindowLink>, L<LibTmux::Session>, and L<LibTmux::Client>. | ||
| 39 | |||
| 40 | =head2 server_id | ||
| 41 | |||
| 42 | Return the captured server scope. No daemon discovery or refresh occurs. | ||
| 43 | |||
| 44 | =head2 generation | ||
| 45 | |||
| 46 | Return the captured generation. Restarted daemons cannot silently reuse this handle. | ||
| 47 | |||
| 48 | =head2 identity | ||
| 49 | |||
| 50 | Return an opaque identity key scoped by server, generation, kind, and string ID. It is suitable for local equality; duplicate selection occurrences remain separate occurrences. | ||
| 51 | |||
| 52 | =head2 to_record | ||
| 53 | |||
| 54 | Return a fresh hash reference of captured scalar fields and adjacency IDs. Editing it does not change the retained graph. Retaining the entity retains its captured graph, with no transport ownership or reference cycle. | ||
| 55 | |||
| 56 | =head1 EXECUTION | ||
| 57 | |||
| 58 | All methods in this module operate on local captured data and perform no tmux | ||
| 59 | I/O. Ordering is deterministic; public query methods do not mutate membership. | ||
| 60 | Typed validation/evaluation errors propagate. See L<LibTmux::Server/snapshot> | ||
| 61 | for explicit acquisition and L<LibTmux::X> for machine-readable failures. | ||
| 62 | |||
| 63 | =cut | ||