Skip to content

Commit 323442e

Browse files
committed
add iterator
Signed-off-by: George Lemon <georgelemon@protonmail.com>
1 parent 17e0176 commit 323442e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/pluginkit.nim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,11 @@ else:
475475
# Plugin public API
476476
#
477477

478+
iterator plugins*(manager: PluginManager|ptr PluginManager): Plugin =
479+
## An iterator that yields all the currently loaded plugins in the manager.
480+
for p in manager.plugins.values:
481+
yield p
482+
478483
proc getId*(plugin: Plugin): lent string =
479484
## Returns the unique identifier of the plugin. This identifier is generated
480485
## using a hash of the plugin's path, name, and version, ensuring that each

0 commit comments

Comments
 (0)