This commit is contained in:
Dante
2026-05-21 20:15:16 -07:00
parent fe8bd1e307
commit add4d4cc87
2664 changed files with 198448 additions and 0 deletions

View File

@ -0,0 +1,47 @@
package eval.luv;
/**
Network address families.
**/
enum AddressFamily {
UNSPEC;
INET;
INET6;
OTHER(i:Int);
}
/**
Socket types.
**/
enum SocketType {
STREAM;
DGRAM;
RAW;
OTHER(i:Int);
}
/**
Binds `struct sockaddr`.
@see https://aantron.github.io/luv/luv/Luv/Sockaddr
**/
@:coreType abstract SockAddr {
/** Extracts the port in a network address. */
public var port(get,never):Null<Int>;
function get_port():Null<Int>;
/**
Converts a string and port number to an IPv4 struct sockaddr.
**/
static public function ipv4(host:String, port:Int):Result<SockAddr>;
/**
Converts a string and port number to an IPv6 struct sockaddr.
**/
static public function ipv6(host:String, port:Int):Result<SockAddr>;
/**
Converts a network address to a string.
**/
public function toString():String;
}