Răsfoiți Sursa

Add some docs.

whitequark 7 ani în urmă
părinte
comite
2d31ef9665
3 a modificat fișierele cu 5 adăugiri și 0 ștergeri
  1. 1 0
      src/wire/ethernet.rs
  2. 1 0
      src/wire/ip.rs
  3. 3 0
      src/wire/ipv4.rs

+ 1 - 0
src/wire/ethernet.rs

@@ -28,6 +28,7 @@ impl fmt::Display for EtherType {
 pub struct Address(pub [u8; 6]);
 
 impl Address {
+    /// The broadcast address.
     pub const BROADCAST: Address = Address([0xff; 6]);
 
     /// Construct an Ethernet address from a sequence of octets, in big-endian.

+ 1 - 0
src/wire/ip.rs

@@ -135,6 +135,7 @@ pub struct Endpoint {
 }
 
 impl Endpoint {
+    /// An endpoint with unspecified address and port.
     pub const UNSPECIFIED: Endpoint = Endpoint { addr: Address::Unspecified, port: 0 };
 
     /// Create an endpoint address from given address and port.

+ 3 - 0
src/wire/ipv4.rs

@@ -12,7 +12,10 @@ pub use super::IpProtocol as Protocol;
 pub struct Address(pub [u8; 4]);
 
 impl Address {
+    /// An unspecified address.
     pub const UNSPECIFIED: Address = Address([0x00; 4]);
+
+    /// The broadcast address.
     pub const BROADCAST:   Address = Address([0xff; 4]);
 
     /// Construct an IPv4 address from parts.