-module(carpenter@table). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). -export([new/1, name/1, drop/1, give_away/3]). -export_type([table/2]). -opaque table(FWU, FWV) :: {table, gleam@erlang@atom:atom_()} | {gleam_phantom, FWU, FWV}. -spec new(gleam@erlang@atom:atom_()) -> table(any(), any()). new(Name) -> {table, Name}. -spec name(table(any(), any())) -> gleam@erlang@atom:atom_(). name(Table) -> erlang:element(2, Table). -spec drop(table(any(), any())) -> nil. drop(Table) -> ets:delete(erlang:element(2, Table)). -spec give_away(table(any(), any()), gleam@erlang@process:pid_(), any()) -> nil. give_away(Table, Pid, Gift_data) -> ets:give_way(erlang:element(2, Table), Pid, Gift_data).