about summary refs log tree commit diff
path: root/library/std/src/net/addr.rs
AgeCommit message (Collapse)AuthorLines
2022-09-12Use `DisplayBuffer` for socket addresses.Markus Reiter-988/+0
2022-07-17Move SocketAddrCRepr to sys_commonLinus Färnstrand-31/+0
2022-06-23Assign issue number to the new const_socketaddrLinus Färnstrand-3/+3
2022-06-23Remove ntohs/htons in favor of to_be/from_beLinus Färnstrand-5/+5
2022-06-23Implement IpV{4,6}Addr structs with native Rust encodingLinus Färnstrand-7/+4
2022-06-23Represent SocketAddrV4 and SocketAddrV6 as Rust native encodingLinus Färnstrand-91/+86
2022-05-09Use Rust 2021 prelude in std itself.Mara Bos-1/+0
2021-10-30Add #[must_use] to remaining std functions (A-N)John Kugelman-0/+8
2021-10-11Add #[must_use] to is_condition testsJohn Kugelman-0/+2
A continuation of #89718.
2021-10-10Add #[must_use] to core and std constructorsJohn Kugelman-0/+3
2021-09-25Apply 16 commits (squashed)Frank Steffahn-9/+8
---------- Fix spacing for links inside code blocks, and improve link tooltips in alloc::fmt ---------- Fix spacing for links inside code blocks, and improve link tooltips in alloc::{rc, sync} ---------- Fix spacing for links inside code blocks, and improve link tooltips in alloc::string ---------- Fix spacing for links inside code blocks in alloc::vec ---------- Fix spacing for links inside code blocks in core::option ---------- Fix spacing for links inside code blocks, and improve a few link tooltips in core::result ---------- Fix spacing for links inside code blocks in core::{iter::{self, iterator}, stream::stream, poll} ---------- Fix spacing for links inside code blocks, and improve a few link tooltips in std::{fs, path} ---------- Fix spacing for links inside code blocks in std::{collections, time} ---------- Fix spacing for links inside code blocks in and make formatting of `&str`-like types consistent in std::ffi::{c_str, os_str} ---------- Fix spacing for links inside code blocks, and improve link tooltips in std::ffi ---------- Fix spacing for links inside code blocks, and improve a few link tooltips in std::{io::{self, buffered::{bufreader, bufwriter}, cursor, util}, net::{self, addr}} ---------- Fix typo in link to `into` for `OsString` docs ---------- Remove tooltips that will probably become redundant in the future ---------- Apply suggestions from code review Replacing `…std/primitive.reference.html` paths with just `reference` Co-authored-by: Joshua Nelson <github@jyn.dev> ---------- Also replace `…std/primitive.reference.html` paths with just `reference` in `core::pin`
2021-08-22Fix typos “a”→“an”Frank Steffahn-2/+2
2021-07-29Fix may not to appropriate might not or must notAli Malik-1/+1
2021-04-04Rollup merge of #82487 - CDirkx:const-socketaddr, r=m-ou-seYuki Okushi-10/+20
Constify methods of `std::net::SocketAddr`, `SocketAddrV4` and `SocketAddrV6` The following methods are made unstable const under the `const_socketaddr` feature (https://github.com/rust-lang/rust/issues/82485): ```rust // std::net impl SocketAddr { pub const fn ip(&self) -> IpAddr; pub const fn port(&self) -> u16; pub const fn is_ipv4(&self) -> bool; pub const fn is_ipv6(&self) -> bool; } impl SocketAddrV4 { pub const fn ip(&self) -> IpAddr; pub const fn port(&self) -> u16; } impl SocketAddrV6 { pub const fn ip(&self) -> IpAddr; pub const fn port(&self) -> u16; pub const fn flowinfo(&self) -> u32; pub const fn scope_id(&self) -> u32; } ``` Note: `SocketAddrV4::ip` and `SocketAddrV6::ip` use pointer casting and depend on the unstable feature `const_raw_ptr_deref`
2021-03-26Document that the SocketAddr memory representation is not stableLinus Färnstrand-2/+8
2021-02-24Constify methods of `std::net::SocketAddr`, `SocketAddrV4` and `SocketAddrV6`Christiaan Dirkx-10/+20
The following methods are made unstable const under the `const_socketaddr` feature: `SocketAddr` - `ip` - `port` - `is_ipv4` - `is_ipv6` `SocketAddrV4` - `ip` - `port` `SocketAddrV6` - `ip` - `port` - `flowinfo` - `scope_id`
2020-10-04Include scope id in SocketAddrV6::DisplayTamir Duberstein-2/+10
2020-09-22Update library/std/src/net/addr.rsImbolc-1/+1
Co-authored-by: Ivan Tham <pickfire@riseup.net>
2020-09-22Update library/std/src/net/addr.rsImbolc-1/+1
Co-authored-by: Ivan Tham <pickfire@riseup.net>
2020-09-22Update addr.rsImbolc-1/+1
I little clarification
2020-09-02Convert many files to intra-doc linksJoshua Nelson-4/+0
- Use intra-doc links for `std::io` in `std::fs` - Use intra-doc links for File::read in unix/ext/fs.rs - Remove explicit intra-doc links for `true` in `net/addr.rs` - Use intra-doc links in alloc/src/sync.rs - Use intra-doc links in src/ascii.rs - Switch to intra-doc links in alloc/rc.rs - Use intra-doc links in core/pin.rs - Use intra-doc links in std/prelude - Use shorter links in `std/fs.rs` `io` is already in scope.
2020-08-31std: move "mod tests/benches" to separate filesLzu Tao-233/+3
Also doing fmt inplace as requested.
2020-08-19Minor changes to Ipv4AddrLzu Tao-2/+4
* Impl IntoInner rather than AsInner for Ipv4Addr * Add some comments * Add test to show endiannes of Ipv4Addr display
2020-08-16Fix a link, improve method resolutionAlexis Bourget-0/+2
2020-08-15Move to intra doc links in std::netAlexis Bourget-55/+25
2020-07-28Change Debug impl of SocketAddr and IpAddr to match their Display outputLukas Kalbertodt-1/+8
This has already been done for `SocketAddrV4`, `SocketAddrV6`, `IpAddrV4` and `IpAddrV6`. I don't see a point to keep the rather bad to read derived impl, especially when pretty printing: V4( 127.0.0.1 ) From the `Display`, one can easily and unambiguously see if it's V4 or V6. Using `Display` as `Debug` is very convenient for configuration structs (e.g. for webservers) that often just have a `derive(Debug)` and are printed that way to the user.
2020-07-27mv std libs to library/mark-0/+1245