Skip to content

Builder constructor should take arguments #1748

Description

@yoshuawuyts

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/APIRelated to the API or public interfacelifecycle/needs-reviewThe issue has not yet been reviewed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions