reverie-rs / reverie

trace and intercept linux syscalls.
Other
14 stars 5 forks source link

Remaining problems to solve before "counter" example represents clean API usage #41

Open rrnewton opened 5 years ago

rrnewton commented 5 years ago

The counter (or echo) tool should be like "hello world". If there's a bunch of ugly stuff in those examples, that means a minimal usage of our library by a client must include a bunch of ugly stuff. Right now I see three major problems:

The last of these probably deserves its own issue to discuss. If the user wants to override just, say read/write, rather than building their own switch statement inside captured_syscall, and having an essentially untyped argument list, wouldn't it be better if they instead created a trait impl and defined only the read/write we're interested in? Furthermore, we would use more strongly typed signatures when doing so. The idea is that trait-provided methods would provide defaults, including the big fat captured_syscall definition which would have a giant switch statement dispatching to all the specific methods of the trait.