types+x86_64 +linux
types: constants and types related to the Hare type system
The types module provides access to some information about the Hare type system. It provides constants like INT_MAX, which defines the useful range for integer types (see math:: for f32 and f64 limits), as well as types like slice, which describe the internal structure of data types like slices and str.
Submodules
- c: support for C types and ABI interoperation
Index
Types
type floating; type integer; type numeric; type signed; type slice; type string; type unsigned;
Constants
def I16_MAX: i16 = 32767; def I16_MIN: i16 = -32768; def I32_MAX: i32 = 2147483647; def I32_MIN: i32 = -2147483648; def I64_MAX: i64 = 9223372036854775807; def I64_MIN: i64 = -9223372036854775808i64; def I8_MAX: i8 = 127; def I8_MIN: i8 = -128; def INT_MAX: int = I32_MAX; def INT_MIN: int = I32_MIN; def RUNE_MAX: rune = ''; def RUNE_MIN: rune = ' '; def SIZE_MAX: size = U64_MAX; def SIZE_MIN: size = U64_MIN; def U16_MAX: u16 = 65535; def U16_MIN: u16 = 0; def U32_MAX: u32 = 4294967295; def U32_MIN: u32 = 0; def U64_MAX: u64 = 18446744073709551615; def U64_MIN: u64 = 0; def U8_MAX: u8 = 255; def U8_MIN: u8 = 0; def UINTPTR_MAX: uintptr = U64_MAX: uintptr; def UINTPTR_MIN: uintptr = U64_MIN: uintptr; def UINT_MAX: uint = U32_MAX; def UINT_MIN: uint = U32_MIN;
Types
type floating[permalink] [source]
type floating = (f32 | f64);
A tagged union of all floating point numeric types.
type integer[permalink] [source]
type integer = (...signed | ...unsigned);
A tagged union of all integer types, excluding uintptr.
type numeric[permalink] [source]
type numeric = (...integer | ...floating);
A tagged union of all numeric types, excluding uintptr.
type signed[permalink] [source]
type signed = (i8 | i16 | i32 | i64 | int);
A tagged union of all signed integer types.
type slice[permalink] [source]
type slice = struct { // The slice contents. data: nullable *opaque, // The number of members of the slice. length: size, // The allocated capacity (in members) of data. capacity: size, };
A type representing the internal structure of slices, useful for low-level slice manipulation.
type string[permalink] [source]
type string = struct { // UTF-8 encoded octets. data: nullable *[*]u8, // The length capacity, in octets of UTF-8 data. length: size, // The allocated capacity, in octets of UTF-8 data. capacity: size, };
A type representing the internal structure of strings, useful for low-level string manipulation.
type unsigned[permalink] [source]
type unsigned = (u8 | u16 | u32 | u64 | uint | size);
A tagged union of all unsigned integer types, excluding uintptr.
Constants
def I16_MAX[permalink] [source]
def I16_MAX: i16 = 32767;
Maximum value which can be stored in an i16 type.
def I16_MIN[permalink] [source]
def I16_MIN: i16 = -32768;
Minimum value which can be stored in an i16 type.
def I32_MAX[permalink] [source]
def I32_MAX: i32 = 2147483647;
Maximum value which can be stored in an i32 type.
def I32_MIN[permalink] [source]
def I32_MIN: i32 = -2147483648;
Minimum value which can be stored in an i32 type.
def I64_MAX[permalink] [source]
def I64_MAX: i64 = 9223372036854775807;
Maximum value which can be stored in an i64 type.
def I64_MIN[permalink] [source]
def I64_MIN: i64 = -9223372036854775808i64;
Minimum value which can be stored in an i64 type
def I8_MAX[permalink] [source]
def I8_MAX: i8 = 127;
Maximum value which can be stored in an i8 type.
def I8_MIN[permalink] [source]
def I8_MIN: i8 = -128;
Minimum value which can be stored in an i8 type.
def INT_MAX[permalink] [source]
def INT_MAX: int = I32_MAX;
Maximum value which can be stored in an int type.
def INT_MIN[permalink] [source]
def INT_MIN: int = I32_MIN;
Minimum value which can be stored in an int type.
def RUNE_MAX[permalink] [source]
def RUNE_MAX: rune = '';
Maximum Unicode codepoint which can be stored in a rune.
def RUNE_MIN[permalink] [source]
def RUNE_MIN: rune = ' ';
Minimum Unicode codepoint which can be stored in a rune.
def SIZE_MAX[permalink] [source]
def SIZE_MAX: size = U64_MAX;
Maximum value which can be stored in a size type.
def SIZE_MIN[permalink] [source]
def SIZE_MIN: size = U64_MIN;
Minimum value which can be stored in a size type
def U16_MAX[permalink] [source]
def U16_MAX: u16 = 65535;
Maximum value which can be stored in a u16 type.
def U16_MIN[permalink] [source]
def U16_MIN: u16 = 0;
Minimum value which can be stored in a u16 type
def U32_MAX[permalink] [source]
def U32_MAX: u32 = 4294967295;
Maximum value which can be stored in a u32 type.
def U32_MIN[permalink] [source]
def U32_MIN: u32 = 0;
Minimum value which can be stored in a u32 type
def U64_MAX[permalink] [source]
def U64_MAX: u64 = 18446744073709551615;
Maximum value which can be stored in a u64 type.
def U64_MIN[permalink] [source]
def U64_MIN: u64 = 0;
Minimum value which can be stored in a u64 type
def U8_MAX[permalink] [source]
def U8_MAX: u8 = 255;
Maximum value which can be stored in a u8 type.
def U8_MIN[permalink] [source]
def U8_MIN: u8 = 0;
Minimum value which can be stored in a u8 type.
def UINTPTR_MAX[permalink] [source]
def UINTPTR_MAX: uintptr = U64_MAX: uintptr;
Maximum value which can be stored in a uintptr type.
def UINTPTR_MIN[permalink] [source]
def UINTPTR_MIN: uintptr = U64_MIN: uintptr;
Minimum value which can be stored in a uintptr type
def UINT_MAX[permalink] [source]
def UINT_MAX: uint = U32_MAX;
Maximum value which can be stored in a uint type.
def UINT_MIN[permalink] [source]
def UINT_MIN: uint = U32_MIN;
Minimum value which can be stored in a uint type