Home
main
Cmd
exec!
exec_cmd!
exec_output!
exec_output_bytes!
exec_exit_code!
new
new_str
arg
arg_str
args
args_str
env
env_str
envs
envs_str
clear_envs
to_str
to_inspect
Env
platform!
dict!
var!
var_str!
cwd!
set_cwd!
exe_path!
temp_dir!
File
open_reader!
open_reader_with_capacity!
Reader
to_inspect
read_line!
Http
send!
with_json_body
send_json!
get_utf8!
decode_json_response
get!
TransportErr
IOErr
to_str
Locale
parse
from_quote
parser_for
encoder_for
to_str
to_inspect
is_eq
to_hash
get!
all!
ParseErr
OsStr
from_str
utf8
unix
unix_bytes
windows
windows_u16s
from_quote
from_interpolation
to_str_try
display
to_inspect
is_eq
to_hash
to_raw
from_raw
Path
from_os_str
to_os_str
is_file!
is_dir!
is_sym_link!
exists!
type!
read_bytes!
write_bytes!
read_utf8!
write_utf8!
delete!
size_in_bytes!
is_executable!
is_readable!
is_writable!
time_accessed!
time_modified!
time_created!
hard_link!
rename!
create_dir!
create_all!
delete_empty!
delete_all!
list!
utf8
from_quote
from_interpolation
unix
unix_bytes
windows
windows_u16s
to_str
display
to_inspect
is_eq
to_hash
filename
ext
join
to_raw
from_raw
Random
seed_u64!
seed_u32!
Sleep
millis!
Sqlite
prepare!
execute!
query!
query_many!
decode_record
map_value
map_value_result
tagged_value
str
bytes
i64
i32
i16
i8
u64
u32
u16
u8
f64
nullable_str
nullable_bytes
nullable_i64
nullable_i32
nullable_i16
nullable_i8
nullable_u64
nullable_u32
nullable_u16
nullable_u8
nullable_f64
errcode_to_str
Value
Binding
Stmt
to_inspect
execute!
query!
query_many!
ErrCode
DecodeErr
Stderr
line!
write!
write_bytes!
Stdin
line!
bytes!
read_to_end!
Stdout
line!
write!
write_bytes!
Tcp
connect!
connect_err_to_str
stream_err_to_str
Stream
to_inspect
read_up_to!
read_exactly!
read_until!
read_line!
write!
write_utf8!
ConnectErr
StreamErr
Tty
enable_raw_mode!
disable_raw_mode!
Url
parse
from_quote
parser_for
encoder_for
to_str
to_inspect
is_eq
to_hash
scheme
host
port
path
query
fragment
without_fragment
resolve
append_path_segments
append_query_param
query_pairs
with_query
with_fragment
ParseErr
Utc
now!
to_millis_since_epoch
from_millis_since_epoch
to_nanos_since_epoch
from_nanos_since_epoch
delta_as_nanos
delta_as_millis
to_iso_8601
Cmd
.
exec!
:
OsStr
,
List
(
OsStr
)
=>
Try
({ }, [
ExecFailed
({ command :
Str
, exit_code :
I32
}),
FailedToGetExitCode
({ command :
Str
, err :
IOErr
}), ..])
Cmd
.
exec_cmd!
:
Cmd
=>
Try
({ }, [
ExecCmdFailed
({ command :
Str
, exit_code :
I32
}),
FailedToGetExitCode
({ command :
Str
, err :
IOErr
}), ..])
Cmd
.
exec_output!
:
Cmd
=>
Try
({ stdout_utf8 :
Str
, stderr_utf8_lossy :
Str
}, [
StdoutContainsInvalidUtf8
({ cmd_str :
Str
, err : [
BadUtf8
({ problem : _, index :
U64
})] }),
NonZeroExitCode
({ command :
Str
, exit_code :
I32
, stdout_utf8_lossy :
Str
, stderr_utf8_lossy :
Str
}),
FailedToGetExitCode
({ command :
Str
, err :
IOErr
}), ..])
Cmd
.
exec_output_bytes!
:
Cmd
=>
Try
({ stderr_bytes :
List
(
U8
), stdout_bytes :
List
(
U8
) }, [
NonZeroExitCodeB
({ exit_code :
I32
, stdout_bytes :
List
(
U8
), stderr_bytes :
List
(
U8
) }),
FailedToGetExitCodeB
(
IOErr
), ..])
Cmd
.
exec_exit_code!
:
Cmd
=>
Try
(
I32
, [
FailedToGetExitCode
({ command :
Str
, err :
IOErr
}), ..])
Cmd
.
new
:
OsStr
->
Cmd
Cmd
.
new_str
:
Str
->
Cmd
Cmd
.
arg
:
Cmd
,
OsStr
->
Cmd
Cmd
.
arg_str
:
Cmd
,
Str
->
Cmd
Cmd
.
args
:
Cmd
,
List
(
OsStr
)
->
Cmd
Cmd
.
args_str
:
Cmd
,
List
(
Str
)
->
Cmd
Cmd
.
env
:
Cmd
,
OsStr
,
OsStr
->
Cmd
Cmd
.
env_str
:
Cmd
,
Str
,
Str
->
Cmd
Cmd
.
envs
:
Cmd
,
List
((
OsStr
,
OsStr
))
->
Cmd
Cmd
.
envs_str
:
Cmd
,
List
((
Str
,
Str
))
->
Cmd
Cmd
.
clear_envs
:
Cmd
->
Cmd
Cmd
.
to_str
:
Cmd
->
Str
Cmd
.
to_inspect
:
Cmd
->
Str
Env
.
platform!
:
=>
{ arch : [
X86
,
X64
,
ARM
,
AARCH64
,
OTHER
(
Str
)], os : [
LINUX
,
MACOS
,
WINDOWS
,
OTHER
(
Str
)] }
Env
.
dict!
:
=>
List
((
OsStr
,
OsStr
))
Env
.
var!
:
OsStr
=>
Try
(
OsStr
, [
VarNotFound
(
OsStr
),
EnvErr
(
IOErr
), ..])
Env
.
var_str!
:
OsStr
=>
Try
(
Str
, [
VarNotFound
(
OsStr
),
EnvErr
(
IOErr
),
InvalidStr
(
U64
), ..])
Env
.
cwd!
:
=>
Try
(
Path
, [
CwdUnavailable
, ..])
Env
.
set_cwd!
:
Path
=>
Try
({ }, [
InvalidCwd
(
IOErr
), ..])
Env
.
exe_path!
:
=>
Try
(
Path
, [
ExePathUnavailable
, ..])
Env
.
temp_dir!
:
=>
Path
File
.
open_reader!
:
Path
=>
Try
(
Reader
, [
FileErr
(
IOErr
)])
File
.
open_reader_with_capacity!
:
Path
,
U64
=>
Try
(
Reader
, [
FileErr
(
IOErr
)])
File
.
Reader
File.Reader
.
to_inspect
:
Reader
->
Str
File.Reader
.
read_line!
:
Reader
=>
Try
(
List
(
U8
), _)
Http
.
send!
:
Request
=>
Try
(
Response
, [
InvalidUrl
(
ParseErr
),
HttpErr
(
TransportErr
), ..])
Http
.
with_json_body
:
Request
, _
=>
Try
(
Request
, [
JsonErr
(_), ..])
Http
.
send_json!
:
Request
, _
=>
Try
(
Response
, [
JsonErr
(_),
InvalidUrl
(
ParseErr
),
HttpErr
(
TransportErr
), ..])
Http
.
get_utf8!
:
Url
=>
Try
(
Str
, [
BadBody
(
Str
),
InvalidUrl
(
ParseErr
),
HttpErr
(
TransportErr
), ..])
Http
.
decode_json_response
:
Response
=>
Try
(_, [
BadBody
(
Str
),
JsonErr
(_), ..])
Http
.
get!
:
Url
=>
Try
(_, [
BadBody
(
Str
),
InvalidUrl
(
ParseErr
),
HttpErr
(
TransportErr
),
JsonErr
(_), ..])
Http
.
TransportErr
:
TransportErr
IOErr
.
to_str
:
IOErr
->
Str
Locale
.
parse
:
Str
->
Try
(
Locale
,
ParseErr
)
Locale
.
from_quote
:
Str
->
Try
(
Locale
, [
BadQuotedBytes
(
Str
)])
Locale
.
parser_for
:
encoding
->
state
->
Try
({ value :
Locale
, rest :
state
},
err
)
where
[
encoding
.parse_str :
encoding
,
state
->
Try
({ value :
Str
, rest :
state
},
err
),
encoding
.invalid_value :
encoding
,
state
->
err
]
Locale
.
encoder_for
:
encoding
->
Locale
,
state
->
Try
(
state
,
err
)
where
[
encoding
.encode_str :
Str
,
state
->
Try
(
state
,
err
)]
Locale
.
to_str
:
Locale
->
Str
Locale
.
to_inspect
:
Locale
->
Str
Locale
.
is_eq
:
Locale
,
Locale
->
Bool
Locale
.
to_hash
:
Locale
,
Hasher
->
Hasher
Locale
.
get!
:
=>
Try
(
Locale
, [
NotAvailable
, ..])
Locale
.
all!
:
=>
List
(
Locale
)
Locale
.
ParseErr
: [
Empty
,
EmptySubtag
,
InvalidCharacter
,
InvalidLanguage
,
MissingExtensionValue
,
SubtagTooLong
]
OsStr
.
from_str
:
Str
->
OsStr
OsStr
.
utf8
:
Str
->
OsStr
OsStr
.
unix
:
Str
->
OsStr
OsStr
.
unix_bytes
:
List
(
U8
)
->
OsStr
OsStr
.
windows
:
Str
->
OsStr
OsStr
.
windows_u16s
:
List
(
U16
)
->
OsStr
OsStr
.
from_quote
:
Str
->
Try
(
OsStr
, [
BadQuotedBytes
(
Str
)])
OsStr
.
from_interpolation
:
Str
,
Iter
((
Str
,
Str
))
->
OsStr
OsStr
.
to_str_try
:
OsStr
->
Try
(
Str
, [
InvalidStr
(
U64
)])
OsStr
.
display
:
OsStr
->
Str
OsStr
.
to_inspect
:
OsStr
->
Str
OsStr
.
is_eq
:
OsStr
,
OsStr
->
Bool
OsStr
.
to_hash
:
OsStr
,
Hasher
->
Hasher
OsStr
.
to_raw
:
OsStr
->
[
Utf8
(
Str
),
UnixBytes
(
List
(
U8
)),
WindowsU16s
(
List
(
U16
))]
OsStr
.
from_raw
: [
Utf8
(
Str
),
UnixBytes
(
List
(
U8
)),
WindowsU16s
(
List
(
U16
))]
->
OsStr
Path
.
from_os_str
:
OsStr
->
Path
Path
.
to_os_str
:
Path
->
OsStr
Path
.
is_file!
:
Path
=>
Try
(
Bool
, [
PathErr
(
IOErr
), ..])
Path
.
is_dir!
:
Path
=>
Try
(
Bool
, [
PathErr
(
IOErr
), ..])
Path
.
is_sym_link!
:
Path
=>
Try
(
Bool
, [
PathErr
(
IOErr
), ..])
Path
.
exists!
:
Path
=>
Try
(
Bool
, [
PathErr
(
IOErr
), ..])
Path
.
type!
:
Path
=>
Try
([
IsFile
,
IsDir
,
IsSymLink
], [
PathErr
(
IOErr
), ..])
Path
.
read_bytes!
:
Path
=>
Try
(
List
(
U8
), [
PathErr
(
IOErr
), ..])
Path
.
write_bytes!
:
Path
,
List
(
U8
)
=>
Try
({ }, [
PathErr
(
IOErr
), ..])
Path
.
read_utf8!
:
Path
=>
Try
(
Str
, [
PathErr
(
IOErr
), ..])
Path
.
write_utf8!
:
Path
,
Str
=>
Try
({ }, [
PathErr
(
IOErr
), ..])
Path
.
delete!
:
Path
=>
Try
({ }, [
PathErr
(
IOErr
), ..])
Path
.
size_in_bytes!
:
Path
=>
Try
(
U64
, [
PathErr
(
IOErr
), ..])
Path
.
is_executable!
:
Path
=>
Try
(
Bool
, [
PathErr
(
IOErr
), ..])
Path
.
is_readable!
:
Path
=>
Try
(
Bool
, [
PathErr
(
IOErr
), ..])
Path
.
is_writable!
:
Path
=>
Try
(
Bool
, [
PathErr
(
IOErr
), ..])
Path
.
time_accessed!
:
Path
=>
Try
(
U128
, [
PathErr
(
IOErr
), ..])
Path
.
time_modified!
:
Path
=>
Try
(
U128
, [
PathErr
(
IOErr
), ..])
Path
.
time_created!
:
Path
=>
Try
(
U128
, [
PathErr
(
IOErr
), ..])
Path
.
hard_link!
:
Path
,
Path
=>
Try
({ }, [
PathErr
(
IOErr
), ..])
Path
.
rename!
:
Path
,
Path
=>
Try
({ }, [
PathErr
(
IOErr
), ..])
Path
.
create_dir!
:
Path
=>
Try
({ }, [
PathErr
(
IOErr
), ..])
Path
.
create_all!
:
Path
=>
Try
({ }, [
PathErr
(
IOErr
), ..])
Path
.
delete_empty!
:
Path
=>
Try
({ }, [
PathErr
(
IOErr
), ..])
Path
.
delete_all!
:
Path
=>
Try
({ }, [
PathErr
(
IOErr
), ..])
Path
.
list!
:
Path
=>
Try
(
List
(
Path
), [
PathErr
(
IOErr
), ..])
Path
.
utf8
:
Str
->
Path
Path
.
from_quote
:
Str
->
Try
(
Path
, [
BadQuotedBytes
(
Str
)])
Path
.
from_interpolation
:
Str
,
Iter
((
Str
,
Str
))
->
Path
Path
.
unix
:
Str
->
Path
Path
.
unix_bytes
:
List
(
U8
)
->
Path
Path
.
windows
:
Str
->
Path
Path
.
windows_u16s
:
List
(
U16
)
->
Path
Path
.
to_str
:
Path
->
Try
(
Str
, [
InvalidStr
(
U64
)])
Path
.
display
:
Path
->
Str
Path
.
to_inspect
:
Path
->
Str
Path
.
is_eq
:
Path
,
Path
->
Bool
Path
.
to_hash
:
Path
,
Hasher
->
Hasher
Path
.
filename
:
Path
->
Try
(
Path
, [
IsDirPath
,
EndsInDots
])
Path
.
ext
:
Path
->
Try
(
Path
, [
IsDirPath
,
EndsInDots
])
Path
.
join
:
Path
,
Str
->
Path
Path
.
to_raw
:
Path
->
[
Utf8
(
Str
),
UnixBytes
(
List
(
U8
)),
WindowsU16s
(
List
(
U16
))]
Path
.
from_raw
: [
Utf8
(
Str
),
UnixBytes
(
List
(
U8
)),
WindowsU16s
(
List
(
U16
))]
->
Path
Random
.
seed_u64!
:
=>
Try
(
U64
, [
RandomErr
(
IOErr
), ..])
Random
.
seed_u32!
:
=>
Try
(
U32
, [
RandomErr
(
IOErr
), ..])
Sleep
.
millis!
:
U64
=>
{ }
Sqlite
.
prepare!
: { path :
Path
, query :
Str
}
=>
Try
(
Stmt
, [
SqliteErr
(
ErrCode
,
Str
), ..])
Sqlite
.
execute!
: { path :
Path
, query :
Str
, bindings :
List
(
Binding
) }
=>
Try
({ }, [
RowsReturnedUseQueryInstead
,
SqliteErr
(
ErrCode
,
Str
), ..])
Sqlite
.
query!
: { bindings :
List
(
Binding
), path :
Path
, query :
Str
, row :
List
(
Str
)
->
SqliteStmt
->
Try
(
ok
, [
SqliteErr
(
ErrCode
,
Str
), ..[
NoRowsReturned
,
TooManyRowsReturned
]]) }
=>
Try
(
ok
, [
SqliteErr
(
ErrCode
,
Str
), ..[
NoRowsReturned
,
TooManyRowsReturned
]])
Sqlite
.
query_many!
: { bindings :
List
(
Binding
), path :
Path
, query :
Str
, rows :
List
(
Str
)
->
SqliteStmt
->
Try
(
a
, [
SqliteErr
(
ErrCode
,
Str
), ..]) }
=>
Try
(
List
(
a
), [
SqliteErr
(
ErrCode
,
Str
), ..])
Sqlite
.
decode_record
: (
a
->
b
->
[
Ok
(
c
),
Err
(
d
)]), (
a
->
b
->
[
Ok
(
e
),
Err
(
d
)]), (
c
,
e
->
f
)
->
a
->
b
->
[
Err
(
d
), ..[
Ok
(
f
)]]
Sqlite
.
map_value
: (
a
->
b
->
[
Ok
(
c
),
Err
(
d
)]), (
c
->
e
)
->
a
->
b
->
[
Ok
(
e
),
Err
(
d
)]
Sqlite
.
map_value_result
: (
a
->
b
->
[
Ok
(
c
),
Err
(
d
)]), (
c
->
[
Err
(
d
)])
->
a
->
b
->
[
Err
(
d
)]
Sqlite
.
tagged_value
:
a
->
b
->
SqliteStmt
=>
Try
(
SqliteValue
, [
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
)])
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
str
:
a
->
b
->
SqliteStmt
=>
[
Err
([
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
]),
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
)]), ..[
Ok
(
Str
)]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
bytes
:
a
->
b
->
SqliteStmt
=>
[
Err
([
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
]),
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
)]), ..[
Ok
(
List
(
U8
))]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
i64
:
a
->
b
->
SqliteStmt
=>
[
Err
([
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
),
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
])]),
Ok
(
I64
)]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
i32
:
a
->
b
->
SqliteStmt
=>
[
Err
([
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
),
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
]),
IntOutOfBounds
]), ..[
Ok
(
I32
)]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
i16
:
a
->
b
->
SqliteStmt
=>
[
Err
([
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
),
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
]),
IntOutOfBounds
]), ..[
Ok
(
I16
)]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
i8
:
a
->
b
->
SqliteStmt
=>
[
Err
([
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
),
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
]),
IntOutOfBounds
]), ..[
Ok
(
I8
)]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
u64
:
a
->
b
->
SqliteStmt
=>
[
Err
([
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
),
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
]),
IntOutOfBounds
]), ..[
Ok
(
U64
)]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
u32
:
a
->
b
->
SqliteStmt
=>
[
Err
([
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
),
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
]),
IntOutOfBounds
]), ..[
Ok
(
U32
)]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
u16
:
a
->
b
->
SqliteStmt
=>
[
Err
([
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
),
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
]),
IntOutOfBounds
]), ..[
Ok
(
U16
)]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
u8
:
a
->
b
->
SqliteStmt
=>
[
Err
([
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
),
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
]),
IntOutOfBounds
]), ..[
Ok
(
U8
)]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
f64
:
a
->
b
->
SqliteStmt
=>
[
Err
([
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
),
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
])]),
Ok
(
F64
)]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
nullable_str
:
a
->
b
->
SqliteStmt
=>
[
Err
([
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
]),
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
)]), ..[
Ok
([
NotNull
(
Str
),
Null
])]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
nullable_bytes
:
a
->
b
->
SqliteStmt
=>
[
Err
([
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
]),
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
)]), ..[
Ok
([
NotNull
(
List
(
U8
)),
Null
])]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
nullable_i64
:
a
->
b
->
SqliteStmt
=>
[
Err
([
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
),
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
])]), ..[
Ok
([
NotNull
(
I64
),
Null
])]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
nullable_i32
:
a
->
b
->
SqliteStmt
=>
[
Err
([
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
),
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
]),
IntOutOfBounds
]), ..[
Ok
([
NotNull
(
I32
),
Null
])]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
nullable_i16
:
a
->
b
->
SqliteStmt
=>
[
Err
([
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
),
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
]),
IntOutOfBounds
]), ..[
Ok
([
NotNull
(
I16
),
Null
])]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
nullable_i8
:
a
->
b
->
SqliteStmt
=>
[
Err
([
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
),
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
]),
IntOutOfBounds
]), ..[
Ok
([
NotNull
(
I8
),
Null
])]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
nullable_u64
:
a
->
b
->
SqliteStmt
=>
[
Err
([
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
),
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
]),
IntOutOfBounds
]), ..[
Ok
([
NotNull
(
U64
),
Null
])]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
nullable_u32
:
a
->
b
->
SqliteStmt
=>
[
Err
([
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
),
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
]),
IntOutOfBounds
]), ..[
Ok
([
NotNull
(
U32
),
Null
])]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
nullable_u16
:
a
->
b
->
SqliteStmt
=>
[
Err
([
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
),
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
]),
IntOutOfBounds
]), ..[
Ok
([
NotNull
(
U16
),
Null
])]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
nullable_u8
:
a
->
b
->
SqliteStmt
=>
[
Err
([
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
),
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
]),
IntOutOfBounds
]), ..[
Ok
([
NotNull
(
U8
),
Null
])]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
nullable_f64
:
a
->
b
->
SqliteStmt
=>
[
Err
([
NoSuchField
(
a
),
SqliteErr
(
ErrCode
,
Str
),
UnexpectedType
([
Bytes
,
Integer
,
Null
,
Real
,
String
])]), ..[
Ok
([
NotNull
(
F64
),
Null
])]]
where
[
a
.is_eq :
a
,
a
->
Bool
,
b
.find_first_index :
a
, (
b
->
Bool
)
->
[
Ok
(
U64
),
Err
([
NotFound
])]]
Sqlite
.
errcode_to_str
: [
Abort
,
AuthDenied
,
Busy
,
CanNotOpen
,
Constraint
,
Corrupt
,
Done
,
Empty
,
Error
,
Format
,
Full
,
IOErr
,
Internal
,
Interrupt
,
Locked
,
Mismatch
,
Misuse
,
NoLFS
,
NoMem
,
NotADatabase
,
NotFound
,
Notice
,
OutOfRange
,
Perm
,
Protocol
,
ReadOnly
,
Row
,
Schema
,
TooBig
,
Warning
,
Unknown
(
I64
)]
->
Str
Sqlite
.
Value
: [
Null
,
Real
(
F64
),
Integer
(
I64
),
String
(
Str
),
Bytes
(
List
(
U8
))]
Sqlite
.
Binding
: { name :
Str
, value :
Value
}
Sqlite
.
Stmt
Sqlite.Stmt
.
to_inspect
:
Stmt
->
Str
Sqlite.Stmt
.
execute!
:
Stmt
,
List
(
Binding
)
=>
Try
({ }, [
RowsReturnedUseQueryInstead
,
SqliteErr
(
ErrCode
,
Str
), ..])
Sqlite.Stmt
.
query!
:
Stmt
,
List
(
Binding
), (
List
(
Str
)
->
SqliteStmt
->
Try
(
ok
, [
SqliteErr
(
ErrCode
,
Str
), ..[
NoRowsReturned
,
TooManyRowsReturned
]]))
->
Try
(
ok
, [
SqliteErr
(
ErrCode
,
Str
), ..[
NoRowsReturned
,
TooManyRowsReturned
]])
Sqlite.Stmt
.
query_many!
:
Stmt
,
List
(
Binding
), (
List
(
Str
)
->
SqliteStmt
->
Try
(
a
, [
SqliteErr
(
ErrCode
,
Str
), ..]))
->
Try
(
List
(
a
), [
SqliteErr
(
ErrCode
,
Str
), ..])
Sqlite
.
ErrCode
: [
Error
,
Internal
,
Perm
,
Abort
,
Busy
,
Locked
,
NoMem
,
ReadOnly
,
Interrupt
,
IOErr
,
Corrupt
,
NotFound
,
Full
,
CanNotOpen
,
Protocol
,
Empty
,
Schema
,
TooBig
,
Constraint
,
Mismatch
,
Misuse
,
NoLFS
,
AuthDenied
,
Format
,
OutOfRange
,
NotADatabase
,
Notice
,
Warning
,
Row
,
Done
,
Unknown
(
I64
)]
Sqlite
.
DecodeErr
: [
NoSuchField
(
Str
),
SqliteErr
(
ErrCode
,
Str
)]
Stderr
.
line!
:
Str
=>
Try
({ }, [
StderrErr
(
IOErr
), ..])
Stderr
.
write!
:
Str
=>
Try
({ }, [
StderrErr
(
IOErr
), ..])
Stderr
.
write_bytes!
:
List
(
U8
)
=>
Try
({ }, [
StderrErr
(
IOErr
), ..])
Stdin
.
line!
:
=>
Try
(
Str
, [
EndOfFile
,
StdinErr
(
IOErr
), ..])
Stdin
.
bytes!
:
=>
Try
(
List
(
U8
), [
EndOfFile
,
StdinErr
(
IOErr
), ..])
Stdin
.
read_to_end!
:
=>
Try
(
List
(
U8
), [
StdinErr
(
IOErr
), ..])
Stdout
.
line!
:
Str
=>
Try
({ }, [
StdoutErr
(
IOErr
), ..])
Stdout
.
write!
:
Str
=>
Try
({ }, [
StdoutErr
(
IOErr
), ..])
Stdout
.
write_bytes!
:
List
(
U8
)
=>
Try
({ }, [
StdoutErr
(
IOErr
), ..])
Tcp
.
connect!
:
Str
,
U16
=>
Try
(
Stream
, [
AddrInUse
,
AddrNotAvailable
,
ConnectionRefused
,
Interrupted
,
PermissionDenied
,
TimedOut
,
Unrecognized
(
Str
),
Unsupported
])
Tcp
.
connect_err_to_str
: [
AddrInUse
,
AddrNotAvailable
,
ConnectionRefused
,
Interrupted
,
PermissionDenied
,
TimedOut
,
Unsupported
,
Unrecognized
(
a
)]
->
Str
Tcp
.
stream_err_to_str
: [
BrokenPipe
,
ConnectionRefused
,
ConnectionReset
,
Interrupted
,
OutOfMemory
,
PermissionDenied
,
StreamNotFound
,
Unrecognized
(
a
)]
->
Str
Tcp
.
Stream
Tcp.Stream
.
to_inspect
:
Stream
->
Str
Tcp.Stream
.
read_up_to!
:
Stream
,
U64
=>
Try
(
List
(
U8
), _)
Tcp.Stream
.
read_exactly!
:
Stream
,
U64
=>
Try
(
List
(
U8
), _)
Tcp.Stream
.
read_until!
:
Stream
,
U8
=>
Try
(
List
(
U8
), _)
Tcp.Stream
.
read_line!
:
Stream
=>
Try
(
Str
, _)
Tcp.Stream
.
write!
:
Stream
,
List
(
U8
)
=>
Try
({ }, _)
Tcp.Stream
.
write_utf8!
:
Stream
,
Str
=>
Try
({ }, _)
Tcp
.
ConnectErr
: [
PermissionDenied
,
AddrInUse
,
AddrNotAvailable
,
ConnectionRefused
,
Interrupted
,
TimedOut
,
Unsupported
,
Unrecognized
(
Str
)]
Tcp
.
StreamErr
: [
StreamNotFound
,
PermissionDenied
,
ConnectionRefused
,
ConnectionReset
,
Interrupted
,
OutOfMemory
,
BrokenPipe
,
Unrecognized
(
Str
)]
Tty
.
enable_raw_mode!
:
=>
{ }
Tty
.
disable_raw_mode!
:
=>
{ }
Url
.
parse
:
Str
->
Try
(
Url
,
ParseErr
)
Url
.
from_quote
:
Str
->
Try
(
Url
, [
BadQuotedBytes
(
Str
)])
Url
.
parser_for
:
encoding
->
state
->
Try
({ value :
Url
, rest :
state
},
err
)
where
[
encoding
.parse_str :
encoding
,
state
->
Try
({ value :
Str
, rest :
state
},
err
),
encoding
.invalid_value :
encoding
,
state
->
err
]
Url
.
encoder_for
:
encoding
->
Url
,
state
->
Try
(
state
,
err
)
where
[
encoding
.encode_str :
Str
,
state
->
Try
(
state
,
err
)]
Url
.
to_str
:
Url
->
Str
Url
.
to_inspect
:
Url
->
Str
Url
.
is_eq
:
Url
,
Url
->
Bool
Url
.
to_hash
:
Url
,
Hasher
->
Hasher
Url
.
scheme
:
Url
->
[
Http
,
Https
]
Url
.
host
:
Url
->
Str
Url
.
port
:
Url
->
[
None
,
Some
(
U16
)]
Url
.
path
:
Url
->
Str
Url
.
query
:
Url
->
[
None
,
Some
(
Str
)]
Url
.
fragment
:
Url
->
[
None
,
Some
(
Str
)]
Url
.
without_fragment
:
Url
->
Url
Url
.
resolve
:
Url
,
Str
->
Try
(
Url
,
ParseErr
)
Url
.
append_path_segments
:
Url
,
List
(
Str
)
->
Url
Url
.
append_query_param
:
Url
,
Str
,
Str
->
Url
Url
.
query_pairs
:
Url
->
List
((
Str
,
Str
))
Url
.
with_query
:
Url
, [
None
,
Some
(
Str
)]
->
Try
(
Url
,
ParseErr
)
Url
.
with_fragment
:
Url
, [
None
,
Some
(
Str
)]
->
Try
(
Url
,
ParseErr
)
Url
.
ParseErr
: [
CredentialsNotAllowed
,
EmptyHost
,
InternationalHostUnsupported
,
InvalidCharacter
(
U8
),
InvalidHost
(
Str
),
InvalidIpv4
(
Str
),
InvalidIpv6
(
Str
),
InvalidPercentEncoding
(
U64
),
InvalidPort
(
Str
),
MissingAuthority
,
MissingScheme
,
PortOutOfRange
(
U64
),
UnsupportedScheme
(
Str
)]
Utc
.
now!
:
=>
U128
Utc
.
to_millis_since_epoch
:
U128
->
U128
Utc
.
from_millis_since_epoch
:
U128
->
U128
Utc
.
to_nanos_since_epoch
:
U128
->
U128
Utc
.
from_nanos_since_epoch
:
U128
->
U128
Utc
.
delta_as_nanos
:
U128
,
U128
->
U128
Utc
.
delta_as_millis
:
U128
,
U128
->
U128
Utc
.
to_iso_8601
:
U128
->
Str