I was looking at #1746, and I realized that we've made it so the builder takes its arguments as part of the .build method rather than as part of the constructor. This means we have an API like this:
SandboxBuilder::new().build_from_file(hyperlight_guest_path.clone())?;
Instead in Rust it's more common to have the builder constructor take the arguments, for example like with ContextBuilder::from_waker. Adapted to our builder that would change the API to:
SandboxBuilder::from_file(hyperlight_guest_path.clone()).build()?;
It's not a huge difference, but it is just a little shorter, and at least matches my expectations a bit better. @jprendes what do you think?
I was looking at #1746, and I realized that we've made it so the builder takes its arguments as part of the
.buildmethod rather than as part of the constructor. This means we have an API like this:Instead in Rust it's more common to have the builder constructor take the arguments, for example like with
ContextBuilder::from_waker. Adapted to our builder that would change the API to:It's not a huge difference, but it is just a little shorter, and at least matches my expectations a bit better. @jprendes what do you think?