Skip to content

Enforce server binding at compile time instead of runtime panics #263

@coderabbitai

Description

@coderabbitai

Problem

The run() and run_with_shutdown() methods in WireframeServer currently panic at runtime if bind() wasn't called beforehand. This leads to poor developer experience and potential runtime crashes.

Suggested Solution

Consider using a typestate or builder pattern to enforce binding at compile time instead of panicking at runtime. This would make the API safer and catch configuration errors during development rather than in production.

Context

Identified during code review of PR #262: #262
Comment: #262 (comment)
Issue: #263

Files Affected

  • src/server/runtime.rs
  • src/server/config.rs

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions