dylibso / observe-sdk

Continuous runtime observablity SDKs to monitor WebAssembly code.
https://dev.dylibso.com/docs/observe/overview
Apache License 2.0
156 stars 7 forks source link

chore: impl default on options, update calls #106

Closed nilslice closed 1 year ago

nilslice commented 1 year ago

Just converting the default_options function to use rust's built-in concept for this, the Default trait.

- ...start(_, _, default_options())?;
+ ...start(_, _, Default::default())?;

I'm still not 100% sure about the change to the start method though.. and after trying a couple things we might just want to wait and see what user feedback is. The main thing I'm kind of hung up on is whether or not to take an Option<Options> in start or keep it non-optional.

The confusing this is what the actual intent is when None is passed to start... do we use a completely unfiltered trace (what else when there are more fields on Options?) , or should None indicate the "just use the defaults"?

Many Rust programmers will see if Option<T> is the arg, None is a convenient way to say "use nothing", but I don't really know what "nothing" should be in this case.