You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Switch to String before stabilization, as the hostname is guaranteed to be valid ASCII (OsString is therefore unnecessary).
Stabilization PR
Unresolved Questions
Will using netc be fine for all targets that support std, or do we need to do more here? I think so, since any new targets without a libc can just expose the same function signature under netc (gethostname(ptr, len))
Feature gate:
#![feature(gethostname)]This is a tracking issue for retrieving the device's hostname.
rust-lang/libs-team#330 goes into far more detail; basically, "it seems to be a small but useful addition to
std::net"Public API
Steps / History
hostname#146937Unresolved Questions
netcbe fine for all targets that supportstd, or do we need to do more here? I think so, since any new targets without a libc can just expose the same function signature undernetc(gethostname(ptr, len))Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩