#Is it possible to extend the functionality inside of a match statement?

2 messages · Page 1 of 1 (latest)

ebon heron
#

I got my servers and client setup. Now I'm wondering how I can make it so users can extend the functionality and add their own custom matches to handle extra data.

I'm still fairly new to Rust. But something I thought of off the top of my head was passing a function that receives the reader or whatever else data may need to be moved into it. And then everything else is handled in a deeper match inside of there.

https://github.com/Quaint-Studios/Sustenet/blob/5807324ac7a6afab03bb0263f58ebc2cab2127b0/rust/client/src/main.rs#L137-L244

GitHub

Sustenet is a networking solution built with Rust and Zig, formerly C#, for game engines like Unity3D, Godot, and Unreal Engine. The primary focus is on scaling by allowing multiple servers to work...

torn sandal
#

how much would they be able to extend?