Skip to content

Stratum crate: add Method enum #447

Description

@paratoxicdev

Message uses serde_json::Value for params rather than a typed method enum. This means consumers do a two-step parse: match on the method string,
then serde_json::from_value into the concrete type. A typed enum like:

enum Method {
Notify(Notify),
SetDifficulty(SetDifficulty),
Submit(Submit),
// ...
}

would be more ergonomic on the consumer side. The tradeoff is flexibility — Value lets you pass through methods you don't recognize, which
matters for a proxy. Your current approach is pragmatic and arguably the right call for this use case, but it does push parsing responsibility
onto every consumer.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions