Library guide · API index and notation
This page is generated from the bundled library in this checkout. Signatures and adjacent source comments are reproduced below; the linked guide explains usage, storage, failures, and platform support.
import "std/net"
Names used in signatures
Unqualified names denote this package’s types (including other source files in the same package), language built-ins, or generic parameters such as T. Qualified names use the import aliases below. These aliases belong to the library source; import a dependency yourself to use its alias in your program.
| Alias | Package | Source file |
|---|---|---|
io |
std/io |
net.dodo |
Family
Enum · Source
Portable addresses and operation policy: no OS, allocator, clock or scheduler.
pub enum Family {
V4, V6
}
ErrorKind
Enum · Source
pub enum ErrorKind {
InvalidAddress, BufferTooSmall, InvalidInput, WouldBlock, Interrupted,
TimedOut, Cancelled, Closed, ConnectionReset, ConnectionRefused,
AddressInUse, NetworkUnreachable, NameNotFound, Exhausted, Other
}
Error
Struct · Source
pub struct Error {
pub kind: ErrorKind
pub code: i32
pub transferred: usize
}
Error.format
Function · Source
Only fixed kind names and numeric metadata; never input or native messages.
pub fn format<F>(&self, output: &mut F) -> void!io.Error
failure
Function · Source
pub fn failure(kind: ErrorKind) -> Error
Shutdown
Enum · Source
pub enum Shutdown {
Read, Write, Both
}
Interest
Enum · Source
pub enum Interest {
Read, Write
}
IpAddress
Struct · Source
pub struct IpAddress {
pub family: Family
// IPv4 occupies the first four bytes; its remaining bytes are zero.
pub octets: [16]u8
}
IpAddress.v4
Function · Source
pub fn v4(a: u8, b: u8, c: u8, d: u8) -> IpAddress
IpAddress.v6
Function · Source
pub fn v6(bytes: [16]u8) -> IpAddress
IpAddress.clone
Function · Source
pub fn clone(&self) -> IpAddress
IpAddress.equals
Function · Source
pub fn equals(&self, other: &IpAddress) -> bool
SocketAddress
Struct · Source
pub struct SocketAddress {
pub ip: IpAddress
pub port: u16
// Numeric interface index; names require an optional platform extension.
pub scope_id: u32
}
SocketAddress.new
Function · Source
pub fn new(ip: IpAddress, port: u16) -> SocketAddress
SocketAddress.clone
Function · Source
pub fn clone(&self) -> SocketAddress
parse_v4
Function · Source
pub fn parse_v4(input: &[u8]) -> IpAddress!Error
parse_v6
Function · Source
pub fn parse_v6(input: &[u8]) -> IpAddress!Error
parse_ip
Function · Source
pub fn parse_ip(input: &[u8]) -> IpAddress!Error
parse_socket
Function · Source
pub fn parse_socket(input: &[u8]) -> SocketAddress!Error
format_ip
Function · Source
Output is unchanged on BufferTooSmall. No trailing NUL is written.
pub fn format_ip(ip: &IpAddress, output: &mut[u8]) -> usize!Error
format_socket
Function · Source
pub fn format_socket(address: &SocketAddress, output: &mut[u8]) -> usize!Error
Operation
Struct · Source
Absolute milliseconds in an explicit provider’s clock domain. None means no deadline; clocks must be monotonic. Cancellation is checked before an attempt.
pub struct Operation {
pub deadline: Option<u64>
}
Operation.unlimited
Function · Source
pub fn unlimited() -> Operation
Operation.until
Function · Source
pub fn until(milliseconds: u64) -> Operation
Operation.check
Function · Source
pub fn check<C, X>(&self, clock: &mut C, cancel: &X) -> void!Error
NeverCancel
Struct · Source
pub struct NeverCancel {
}
NeverCancel.cancelled
Function · Source
pub fn cancelled(&self) -> bool
Cancellation
Struct · Source
pub struct Cancellation {
// Private implementation fields omitted.
}
Cancellation.new
Function · Source
pub fn new() -> Cancellation
Cancellation.cancel
Function · Source
pub fn cancel(&mut self)
Cancellation.cancelled
Function · Source
pub fn cancelled(&self) -> bool