Skip to content

ToSocketAddrs in Server::bind() and Server::try_bind() #3000

Open
@ricvelozo

Description

@ricvelozo

Is your feature request related to a problem? Please describe.
Reduce boilerplate, like the actix-web and the std lib too. Currently it needs:

let addr = SocketAddr::from(("127.0.0.1", 8080));
Server::bind(&addr)

Describe the solution you'd like

pub fn bind<A: ToSocketAddrs>(addr: A) -> Builder<AddrIncoming> { /* ... */ }

// Will allow:
Server::bind(("127.0.0.1", 8080))

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-serverArea: server.C-featureCategory: feature. This is adding a new feature.E-easyEffort: easy. A task that would be a great starting point for a new contributor.K-hyper-utilCrate: hyper-util

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions