summaryrefslogtreecommitdiff
path: root/channel.lua
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2025-02-22 00:20:52 +0000
committerubq323 <ubq323@ubq323.website>2025-02-22 00:20:52 +0000
commit989b6349b0c7e5a0d7ec06d2ca24d629c618fe12 (patch)
treec424e6eac3ee626db4b4993def6eda4b9292eb66 /channel.lua
parentbf776624fb59d147b82d2a6a13c36292844a47b7 (diff)
many thingsHEADtrunk
Diffstat (limited to 'channel.lua')
-rw-r--r--channel.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/channel.lua b/channel.lua
new file mode 100644
index 0000000..e908069
--- /dev/null
+++ b/channel.lua
@@ -0,0 +1,15 @@
+-- channel descriptor
+
+local Channel = {}
+function Channel.make(pylon, descriptor)
+ return setmetatable({pylon=pylon, descriptor=descriptor}, Channel)
+end
+function Channel.__eq(self, other)
+ return self.pylon == other.pylon and self.descriptor == other.descriptor
+end
+function Channel.__call(_, ...) return Channel.make(...) end
+function Channel.__tostring(self)
+ return self.pylon.name .. ':' .. self.descriptor
+end
+setmetatable(Channel, Channel)
+return Channel