Rustd: A rusty utility library for Roblox and Luau

A rusty luau module meant to be used with strictly-typed luau.

Toolbox link

Types

Result<T,E> - A union of Ok and Err types.
Ok<T> - A success result.
Err<T> - An error result.
Pair<A,B> - Unsafe type used internally to streamline matching with rustd:match.

Functions

rustd:match<T>(value_to_match: T, ...: {any}): any
rustd:find_child(parent: Instance, pattern: string): Result<Instance,string>
rustd:find_child_of_class(parent: Instance, class_name: string): Result<Instance,string>
rustd:find_descendant(parent: Instance, pattern: string): Result<Instance,string>
rustd:find_descendant_of_class(parent: Instance, class_name: string): Result<Instance,string>
rustd:push_error(msg: string): ()

Documentation

Documentation may be found on the github repo.

Conclusion

Please don’t be afraid to leave suggestions for other implementations you would want me to try to add in this module! I’ll try my best to add them!
This module will not work with the new type solver until it is fully released, unfortunately.

4 Likes

pls add Arc<Mutex<Box>> thanks

1 Like

:fearful:
mutex might not be a bad idea but i feel like that would be more at home implemented with promises and other async stuff