Skip to content

Consistent way of using builders and options #1000

Description

@yukibtc

Currently, around the code, we use both builders and options. Before reach beta or release stage, we should define a standard/common way of using these

Ideally:

  • use builders for constructors;
  • use options for methods.

Example:

// Constructing -> use a builder
let client = Client::builder().database(database).signer(signer).verify_subscriptions(true).gossip(true).build();

// Method which can be customized -> use options
let opts = SyncOptions::default().direction(..);
let event = client.sync(filter, opts).await?;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions