Home
main
Cmd
new
arg
args
env
envs
clear_envs
cwd
stdin
stdout
stderr
inherit_stdio
timeout
output_limit
pending_limit
manage_tree
exec!
capture!
run!
spawn!
check_available!
to_str
to_inspect
StdinMode
StdoutMode
StderrMode
ExitStatus
PartialOutput
Err
is_eq
to_str
to_inspect
Output
is_eq
require_success
stdout_utf8
stdout_utf8_lossy
stderr_utf8_lossy
to_inspect
Child
pid
wait!
poll!
kill!
close_stdin!
close!
read!
write_bytes!
write_utf8!
Duration
zero
nanos
millis
seconds
minutes
to_nanos
to_millis
to_seconds
to_str
to_inspect
sleep!
plus
minus
is_eq
is_lt
is_lte
is_gt
is_gte
order_relative_to
Env
platform!
dict!
var!
var_str!
cwd!
set_cwd!
exe_path!
program_name!
create_temp_dir!
create_temp_dir_with_prefix!
create_temp_dir_in!
with_temp_dir!
temp_dir!
File
open_reader!
open_reader_with_capacity!
open_writer!
with_writer!
SeekFrom
Reader
to_inspect
read_up_to!
read_exactly!
read_until!
read_line!
position!
seek!
lines
chunks
WriteMode
Writer
to_inspect
write_bytes!
write_utf8!
write_stream!
flush!
Http
send!
with_json_body
send_json!
get_utf8!
decode_json_response
get!
send_streaming!
TransportErr
StreamingOptions
StreamingResponse
to_inspect
status
headers
content_length
chunks
read_to_end!
IOErr
is_eq
to_str
Locale
parse
from_quote
parser_for
encoder_for
to_str
to_inspect
is_eq
to_hash
get!
all!
ParseErr
Monotonic
now!
since
elapsed!
OsStr
from_str
utf8
unix
unix_bytes
windows
windows_u16s
from_quote
from_interpolation
parser_for
encoder_for
to_str_try
to_bytes
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!
absolute!
canonicalize!
copy!
copy_dir!
copy_dir_with!
read_bytes!
write_bytes!
read_utf8!
write_utf8!
append_bytes!
append_utf8!
replace_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
parser_for
encoder_for
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!
seconds!
Sqlite
open!
open_in_memory!
Value
OpenOptions
Db
to_inspect
close!
execute!
execute_script!
query_one!
query_all!
rows
transaction!
Query
from_quote
from_interpolation
new
Column
is_eq
from_quote
from_numeral
ErrCode
Err
is_eq
to_str
DecodeErr
Row
Decoder
map2
map
map_try
nullable
i64
f64
bool
bytes
str
value
row
Stderr
line!
write!
write_bytes!
Stdin
line!
bytes!
read_to_end!
lines
chunks
Stdout
line!
write!
write_bytes!
Tcp
listen!
connect!
Listener
to_inspect
local_port!
accept!
close!
Connection
to_inspect
with_timeout
with_line_limit
read_up_to!
read_exactly!
read_until!
read_line!
write_bytes!
write_utf8!
chunks
lines
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!
from_nanos_since_epoch
to_nanos_since_epoch
from_millis_since_epoch
to_millis_since_epoch
since
to_iso_8601
to_inspect
is_eq
is_lt
is_lte
is_gt
is_gte
order_relative_to
Cmd
.
new
:
OsStr
->
Cmd
Cmd
.
arg
:
Cmd
,
OsStr
->
Cmd
Cmd
.
args
:
Cmd
,
List
(
OsStr
)
->
Cmd
Cmd
.
env
:
Cmd
,
OsStr
,
OsStr
->
Cmd
Cmd
.
envs
:
Cmd
,
List
((
OsStr
,
OsStr
))
->
Cmd
Cmd
.
clear_envs
:
Cmd
->
Cmd
Cmd
.
cwd
:
Cmd
,
Path
->
Cmd
Cmd
.
stdin
:
Cmd
,
StdinMode
->
Cmd
Cmd
.
stdout
:
Cmd
,
StdoutMode
->
Cmd
Cmd
.
stderr
:
Cmd
,
StderrMode
->
Cmd
Cmd
.
inherit_stdio
:
Cmd
->
Cmd
Cmd
.
timeout
:
Cmd
,
Duration
->
Cmd
Cmd
.
output_limit
:
Cmd
, [
NoLimit
,
MaxBytes
(
U64
)]
->
Cmd
Cmd
.
pending_limit
:
Cmd
,
U64
->
Cmd
Cmd
.
manage_tree
:
Cmd
,
Bool
->
Cmd
Cmd
.
exec!
:
Cmd
=>
Try
({}, [
CmdErr
(
Err
),
BadExitStatus
(
Output
)])
Cmd
.
capture!
:
Cmd
=>
Try
(
Str
, [
CmdErr
(
Err
),
BadExitStatus
(
Output
),
BadUtf8
({ problem :
Utf8Problem
, index :
U64
})])
Cmd
.
run!
:
Cmd
=>
Try
(
Output
, [
CmdErr
(
Err
)])
Cmd
.
spawn!
:
Cmd
=>
Try
(
Child
, [
CmdErr
(
Err
)])
Cmd
.
check_available!
:
Str
=>
Bool
Cmd
.
to_str
:
Cmd
->
Str
Cmd
.
to_inspect
:
Cmd
->
Str
Cmd
.
StdinMode
: [
Inherit
,
Null
,
Bytes
(
List
(
U8
)),
Pipe
]
Cmd
.
StdoutMode
: [
Inherit
,
Null
,
Capture
,
Tee
,
Pipe
]
Cmd
.
StderrMode
: [
Inherit
,
Null
,
Capture
,
Tee
,
Pipe
,
MergeWithStdout
]
Cmd
.
ExitStatus
: [
Exited
(
I32
),
Signaled
(
I32
)]
Cmd
.
PartialOutput
: { stdout_bytes :
List
(
U8
), stderr_bytes :
List
(
U8
) }
Cmd
.
Err
:= [
StartFailed
(
IOErr
,
OsStr
),
TimedOut
(
PartialOutput
),
OutputLimitExceeded
(
PartialOutput
),
IOErr
(
IOErr
)]
Cmd.Err
.
is_eq
: _
Cmd.Err
.
to_str
:
Err
->
Str
Cmd.Err
.
to_inspect
:
Err
->
Str
Cmd
.
Output
:= { command :
Str
, status :
ExitStatus
, stdout_bytes :
List
(
U8
), stderr_bytes :
List
(
U8
) }
Cmd.Output
.
is_eq
: _
Cmd.Output
.
require_success
:
Output
->
Try
(
Output
, [
BadExitStatus
(
Output
)])
Cmd.Output
.
stdout_utf8
:
Output
->
Try
(
Str
, [
BadUtf8
({ problem :
Utf8Problem
, index :
U64
})])
Cmd.Output
.
stdout_utf8_lossy
:
Output
->
Str
Cmd.Output
.
stderr_utf8_lossy
:
Output
->
Str
Cmd.Output
.
to_inspect
:
Output
->
Str
Cmd
.
Child
Cmd.Child
.
pid
:
Child
->
U32
Cmd.Child
.
wait!
:
Child
=>
Try
(
Output
, [
CmdErr
(
Err
),
Closed
])
Cmd.Child
.
poll!
:
Child
=>
Try
([
Running
,
Finished
(
Output
)], [
CmdErr
(
Err
),
Closed
])
Cmd.Child
.
kill!
:
Child
=>
Try
({}, [
CmdErr
(
Err
),
Closed
])
Cmd.Child
.
close_stdin!
:
Child
=>
Try
({}, [
CmdErr
(
Err
),
Closed
])
Cmd.Child
.
close!
:
Child
=>
Try
({}, [
CmdErr
(
Err
)])
Cmd.Child
.
read!
:
Child
,
Duration
=>
Try
([
Stdout
(
List
(
U8
)),
Stderr
(
List
(
U8
))], [
EndOfInput
,
CmdErr
(
Err
),
Closed
])
Cmd.Child
.
write_bytes!
:
Child
,
List
(
U8
),
Duration
=>
Try
({}, [
CmdErr
(
Err
),
Closed
])
Cmd.Child
.
write_utf8!
:
Child
,
Str
,
Duration
=>
Try
({}, [
CmdErr
(
Err
),
Closed
])
Duration
.
zero
:
Duration
Duration
.
nanos
:
U64
->
Duration
Duration
.
millis
:
U64
->
Duration
Duration
.
seconds
:
U64
->
Duration
Duration
.
minutes
:
U64
->
Duration
Duration
.
to_nanos
:
Duration
->
U64
Duration
.
to_millis
:
Duration
->
U64
Duration
.
to_seconds
:
Duration
->
U64
Duration
.
to_str
:
Duration
->
Str
Duration
.
to_inspect
:
Duration
->
Str
Duration
.
sleep!
:
Duration
=>
{}
Duration
.
plus
:
Duration
,
Duration
->
Duration
Duration
.
minus
:
Duration
,
Duration
->
Duration
Duration
.
is_eq
: _
Duration
.
is_lt
:
Duration
,
Duration
->
Bool
Duration
.
is_lte
:
Duration
,
Duration
->
Bool
Duration
.
is_gt
:
Duration
,
Duration
->
Bool
Duration
.
is_gte
:
Duration
,
Duration
->
Bool
Duration
.
order_relative_to
:
Duration
,
Duration
->
[
Before
,
Same
,
After
]
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
.
program_name!
: ()
=>
Try
(
OsStr
, [
ProgramNameUnavailable
])
Env
.
create_temp_dir!
: ()
=>
Try
(
Path
, [
TempDirErr
(
IOErr
)])
Env
.
create_temp_dir_with_prefix!
:
Str
=>
Try
(
Path
, [
TempDirErr
(
IOErr
)])
Env
.
create_temp_dir_in!
:
Path
,
Str
=>
Try
(
Path
, [
TempDirErr
(
IOErr
)])
Env
.
with_temp_dir!
: (
Path
=>
Try
(
a
,
err
))
=>
Try
(
a
, [
TempDirErr
(
IOErr
),
CallbackErr
(
err
),
CleanupErr
(
IOErr
,
Path
),
CallbackAndCleanupErr
(
err
,
IOErr
,
Path
)])
Env
.
temp_dir!
: ()
=>
Path
File
.
open_reader!
:
Path
=>
Try
(
Reader
, [
PathErr
(
IOErr
,
Path
)])
File
.
open_reader_with_capacity!
:
Path
,
U64
=>
Try
(
Reader
, [
PathErr
(
IOErr
,
Path
)])
File
.
open_writer!
:
Path
,
WriteMode
=>
Try
(
Writer
, [
PathErr
(
IOErr
,
Path
)])
File
.
with_writer!
:
Path
,
WriteMode
, (
Writer
=>
Try
(
a
, [
PathErr
(
IOErr
,
Path
),
FileErr
(
IOErr
), ..
errs
]))
=>
Try
(
a
, [
PathErr
(
IOErr
,
Path
),
FileErr
(
IOErr
), ..
errs
])
File
.
SeekFrom
: [
Start
(
U64
),
Current
(
I64
),
End
(
I64
)]
File
.
Reader
File.Reader
.
to_inspect
:
Reader
->
Str
File.Reader
.
read_up_to!
:
Reader
,
U64
=>
Try
(
List
(
U8
), [
EndOfInput
,
FileErr
(
IOErr
)])
File.Reader
.
read_exactly!
:
Reader
,
U64
=>
Try
(
List
(
U8
), [
UnexpectedEndOfInput
,
FileErr
(
IOErr
)])
File.Reader
.
read_until!
:
Reader
,
U8
=>
Try
(
List
(
U8
), [
EndOfInput
,
FileErr
(
IOErr
)])
File.Reader
.
read_line!
:
Reader
=>
Try
(
Str
, [
EndOfInput
,
BadUtf8
({ problem :
Utf8Problem
, index :
U64
}),
FileErr
(
IOErr
)])
File.Reader
.
position!
:
Reader
=>
Try
(
U64
, [
FileErr
(
IOErr
)])
File.Reader
.
seek!
:
Reader
,
SeekFrom
=>
Try
(
U64
, [
FileErr
(
IOErr
)])
File.Reader
.
lines
:
Reader
->
Stream
(
Try
(
Str
, [
BadUtf8
({ problem :
Utf8Problem
, index :
U64
}),
FileErr
(
IOErr
)]))
File.Reader
.
chunks
:
Reader
->
Stream
(
Try
(
List
(
U8
), [
FileErr
(
IOErr
)]))
File
.
WriteMode
: [
Truncate
,
Append
,
RequireNew
]
File
.
Writer
File.Writer
.
to_inspect
:
Writer
->
Str
File.Writer
.
write_bytes!
:
Writer
,
List
(
U8
)
=>
Try
({}, [
FileErr
(
IOErr
)])
File.Writer
.
write_utf8!
:
Writer
,
Str
=>
Try
({}, [
FileErr
(
IOErr
)])
File.Writer
.
write_stream!
:
Writer
,
Stream
(
Try
(
List
(
U8
),
err
))
=>
Try
({}, [
FileErr
(
IOErr
),
SourceErr
(
err
)])
File.Writer
.
flush!
:
Writer
=>
Try
({}, [
FileErr
(
IOErr
)])
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
.
send_streaming!
:
Request
,
StreamingOptions
=>
Try
(
StreamingResponse
, [
InvalidUrl
(
ParseErr
),
HttpErr
(
TransportErr
)])
Http
.
TransportErr
:
TransportErr
Http
.
StreamingOptions
:= { idle_timeout : [
NoTimeout
,
After
(
Duration
)] ?? After(Duration.seconds(30)) }
Http
.
StreamingResponse
Http.StreamingResponse
.
to_inspect
:
StreamingResponse
->
Str
Http.StreamingResponse
.
status
:
StreamingResponse
->
U16
Http.StreamingResponse
.
headers
:
StreamingResponse
->
List
(
Header
)
Http.StreamingResponse
.
content_length
:
StreamingResponse
->
[
Known
(
U64
),
Unknown
]
Http.StreamingResponse
.
chunks
:
StreamingResponse
->
Stream
(
Try
(
List
(
U8
), [
HttpErr
(
TransportErr
)]))
Http.StreamingResponse
.
read_to_end!
:
StreamingResponse
, [
NoLimit
,
MaxBytes
(
U64
)]
=>
Try
(
List
(
U8
), [
ReadLimitExceeded
(
U64
),
HttpErr
(
TransportErr
)])
IOErr
.
is_eq
: _
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
]
Monotonic
.
now!
: ()
=>
Monotonic
Monotonic
.
since
:
Monotonic
,
Monotonic
->
Duration
Monotonic
.
elapsed!
:
Monotonic
=>
Duration
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
:
List
(
Str
)
->
Try
(
List
(
Str
)
->
OsStr
, [
InvalidInterpolation
(
Str
)])
OsStr
.
parser_for
: _
OsStr
.
encoder_for
: _
OsStr
.
to_str_try
:
OsStr
->
Try
(
Str
, [
InvalidStr
(
U64
)])
OsStr
.
to_bytes
:
OsStr
->
List
(
U8
)
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
)])
Path
.
is_dir!
:
Path
=>
Try
(
Bool
, [
PathErr
(
IOErr
,
Path
)])
Path
.
is_sym_link!
:
Path
=>
Try
(
Bool
, [
PathErr
(
IOErr
,
Path
)])
Path
.
exists!
:
Path
=>
Try
(
Bool
, [
PathErr
(
IOErr
,
Path
)])
Path
.
type!
:
Path
=>
Try
([
IsFile
,
IsDir
,
IsSymLink
,
IsOther
], [
PathErr
(
IOErr
,
Path
)])
Path
.
absolute!
:
Path
=>
Try
(
Path
, [
PathErr
(
IOErr
,
Path
)])
Path
.
canonicalize!
:
Path
=>
Try
(
Path
, [
PathErr
(
IOErr
,
Path
)])
Path
.
copy!
:
Path
,
Path
=>
Try
({}, [
CopyErr
({ operation :
Str
, source :
Path
, destination :
Path
, error :
IOErr
})])
Path
.
copy_dir!
:
Path
,
Path
=>
Try
({}, [
CopyErr
({ operation :
Str
, source :
Path
, destination :
Path
, error :
IOErr
})])
Path
.
copy_dir_with!
:
Path
,
Path
, { symlinks : [
Follow
,
Preserve
], destination : [
RequireNew
,
Merge
] }
=>
Try
({}, [
CopyErr
({ operation :
Str
, source :
Path
, destination :
Path
, error :
IOErr
})])
Path
.
read_bytes!
:
Path
=>
Try
(
List
(
U8
), [
PathErr
(
IOErr
,
Path
)])
Path
.
write_bytes!
:
Path
,
List
(
U8
)
=>
Try
({}, [
PathErr
(
IOErr
,
Path
)])
Path
.
read_utf8!
:
Path
=>
Try
(
Str
, [
PathErr
(
IOErr
,
Path
)])
Path
.
write_utf8!
:
Path
,
Str
=>
Try
({}, [
PathErr
(
IOErr
,
Path
)])
Path
.
append_bytes!
:
Path
,
List
(
U8
)
=>
Try
({}, [
PathErr
(
IOErr
,
Path
)])
Path
.
append_utf8!
:
Path
,
Str
=>
Try
({}, [
PathErr
(
IOErr
,
Path
)])
Path
.
replace_utf8!
:
Path
,
Str
,
Str
=>
Try
({}, [
PathErr
(
IOErr
,
Path
)])
Path
.
delete!
:
Path
=>
Try
({}, [
PathErr
(
IOErr
,
Path
)])
Path
.
size_in_bytes!
:
Path
=>
Try
(
U64
, [
PathErr
(
IOErr
,
Path
)])
Path
.
is_executable!
:
Path
=>
Try
(
Bool
, [
PathErr
(
IOErr
,
Path
)])
Path
.
is_readable!
:
Path
=>
Try
(
Bool
, [
PathErr
(
IOErr
,
Path
)])
Path
.
is_writable!
:
Path
=>
Try
(
Bool
, [
PathErr
(
IOErr
,
Path
)])
Path
.
time_accessed!
:
Path
=>
Try
(
Utc
, [
PathErr
(
IOErr
,
Path
)])
Path
.
time_modified!
:
Path
=>
Try
(
Utc
, [
PathErr
(
IOErr
,
Path
)])
Path
.
time_created!
:
Path
=>
Try
(
Utc
, [
PathErr
(
IOErr
,
Path
)])
Path
.
hard_link!
:
Path
,
Path
=>
Try
({}, [
PathErr
(
IOErr
,
Path
)])
Path
.
rename!
:
Path
,
Path
=>
Try
({}, [
PathErr
(
IOErr
,
Path
)])
Path
.
create_dir!
:
Path
=>
Try
({}, [
PathErr
(
IOErr
,
Path
)])
Path
.
create_all!
:
Path
=>
Try
({}, [
PathErr
(
IOErr
,
Path
)])
Path
.
delete_empty!
:
Path
=>
Try
({}, [
PathErr
(
IOErr
,
Path
)])
Path
.
delete_all!
:
Path
=>
Try
({}, [
PathErr
(
IOErr
,
Path
)])
Path
.
list!
:
Path
=>
Try
(
List
(
Path
), [
PathErr
(
IOErr
,
Path
)])
Path
.
utf8
:
Str
->
Path
Path
.
from_quote
:
Str
->
Try
(
Path
, [
BadQuotedBytes
(
Str
)])
Path
.
from_interpolation
:
List
(
Str
)
->
Try
(
List
(
Str
)
->
Path
, [
InvalidInterpolation
(
Str
)])
Path
.
parser_for
: _
Path
.
encoder_for
: _
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
=>
{}
Sleep
.
seconds!
:
F64
=>
{}
Sqlite
.
open!
:
Path
,
OpenOptions
=>
Try
(
Db
, [
SqliteErr
(
Err
)])
Sqlite
.
open_in_memory!
: ()
=>
Try
(
Db
, [
SqliteErr
(
Err
)])
Sqlite
.
Value
: [
Null
,
Real
(
F64
),
Integer
(
I64
),
String
(
Str
),
Bytes
(
List
(
U8
))]
Sqlite
.
OpenOptions
:= { mode : [
ReadWriteCreate
,
ReadWrite
,
ReadOnly
] ?? ReadWriteCreate, busy_timeout :
Duration
?? Duration.seconds(5) }
Sqlite
.
Db
Sqlite.Db
.
to_inspect
:
Db
->
Str
Sqlite.Db
.
close!
:
Db
=>
Try
({}, [
SqliteErr
(
Err
)])
Sqlite.Db
.
execute!
:
Db
,
Query
=>
Try
({}, [
SqliteErr
(
Err
),
Closed
])
Sqlite.Db
.
execute_script!
:
Db
,
Str
=>
Try
({}, [
SqliteErr
(
Err
),
Closed
])
Sqlite.Db
.
query_one!
:
Db
,
Query
,
Decoder
(
a
,
err
)
=>
Try
(
a
, [
SqliteErr
(
Err
),
Closed
,
NoRows
,
TooManyRows
,
BadRow
(
err
)])
Sqlite.Db
.
query_all!
:
Db
,
Query
,
Decoder
(
a
,
err
)
=>
Try
(
List
(
a
), [
SqliteErr
(
Err
),
Closed
,
BadRow
(
err
)])
Sqlite.Db
.
rows
:
Db
,
Query
,
Decoder
(
a
,
err
)
->
Stream
(
Try
(
a
, [
SqliteErr
(
Err
),
Closed
,
BadRow
(
err
)]))
Sqlite.Db
.
transaction!
:
Db
, (()
=>
Try
(
a
, [
SqliteErr
(
Err
),
Closed
, ..
errs
]))
=>
Try
(
a
, [
SqliteErr
(
Err
),
Closed
, ..
errs
])
Sqlite
.
Query
Sqlite.Query
.
from_quote
:
Str
->
Try
(
Query
, [
BadQuotedBytes
(
Str
)])
Sqlite.Query
.
from_interpolation
:
List
(
Str
)
->
Try
(
List
(
Value
)
->
Query
, [
InvalidInterpolation
(
Str
)])
Sqlite.Query
.
new
:
Str
,
List
(
Value
)
->
Query
Sqlite
.
Column
:= [
Name
(
Str
),
Index
(
U64
)]
Sqlite.Column
.
is_eq
: _
Sqlite.Column
.
from_quote
:
Str
->
Try
(
Column
, [
BadQuotedBytes
(
Str
)])
Sqlite.Column
.
from_numeral
:
Numeral
->
Try
(
Column
, [
InvalidNumeral
(
Str
)])
Sqlite
.
ErrCode
: [
Error
,
Internal
,
Perm
,
Abort
,
Busy
,
Locked
,
NoMem
,
ReadOnly
,
Interrupt
,
Io
,
Corrupt
,
NotFound
,
Full
,
CanNotOpen
,
Protocol
,
Empty
,
Schema
,
TooBig
,
Constraint
([
Unique
,
PrimaryKey
,
ForeignKey
,
NotNull
,
Check
,
Other
]),
Mismatch
,
Misuse
,
NoLFS
,
AuthDenied
,
Format
,
OutOfRange
,
NotADatabase
,
Unknown
(
I64
)]
Sqlite
.
Err
:= [
Failed
({ code :
ErrCode
, extended_code :
I64
, message :
Str
}),
ColumnNotFound
(
Column
),
WrongParamCount
({ expected :
U64
, given :
U64
}),
ReturnsRows
,
MultipleStatements
]
Sqlite.Err
.
is_eq
: _
Sqlite.Err
.
to_str
:
Err
->
Str
Sqlite
.
DecodeErr
: [
UnexpectedType
({ column :
Str
, found : [
Null
,
Integer
,
Real
,
String
,
Bytes
] }),
BadUtf8
({ problem :
Utf8Problem
, index :
U64
})]
Sqlite
.
Row
: { column_names :
List
(
Str
), values :
List
(
Value
) }
Sqlite
.
Decoder
Sqlite.Decoder
.
map2
:
Decoder
(
a
,
err
),
Decoder
(
b
,
err
), (
a
,
b
->
c
)
->
Decoder
(
c
,
err
)
Sqlite.Decoder
.
map
:
Decoder
(
a
,
err
), (
a
->
b
)
->
Decoder
(
b
,
err
)
Sqlite.Decoder
.
map_try
:
Decoder
(
a
,
err
), (
a
->
Try
(
b
,
err
))
->
Decoder
(
b
,
err
)
Sqlite.Decoder
.
nullable
:
Decoder
(
a
,
err
)
->
Decoder
(
Try
(
a
, [
Null
]),
err
)
Sqlite.Decoder
.
i64
:
Column
->
Decoder
(
I64
, [
UnexpectedType
({ column :
Str
, found : [
Null
,
Integer
,
Real
,
String
,
Bytes
] })])
Sqlite.Decoder
.
f64
:
Column
->
Decoder
(
F64
, [
UnexpectedType
({ column :
Str
, found : [
Null
,
Integer
,
Real
,
String
,
Bytes
] })])
Sqlite.Decoder
.
bool
:
Column
->
Decoder
(
Bool
, [
UnexpectedType
({ column :
Str
, found : [
Null
,
Integer
,
Real
,
String
,
Bytes
] })])
Sqlite.Decoder
.
bytes
:
Column
->
Decoder
(
List
(
U8
), [
UnexpectedType
({ column :
Str
, found : [
Null
,
Integer
,
Real
,
String
,
Bytes
] })])
Sqlite.Decoder
.
str
:
Column
->
Decoder
(
Str
, [
UnexpectedType
({ column :
Str
, found : [
Null
,
Integer
,
Real
,
String
,
Bytes
] }),
BadUtf8
({ problem :
Utf8Problem
, index :
U64
})])
Sqlite.Decoder
.
value
:
Column
->
Decoder
(
Value
, [
BadUtf8
({ problem :
Utf8Problem
, index :
U64
})])
Sqlite.Decoder
.
row
:
Decoder
(
Row
, [
BadUtf8
({ problem :
Utf8Problem
, index :
U64
})])
Stderr
.
line!
:
Str
=>
Try
({}, [
StderrErr
(
IOErr
)])
Stderr
.
write!
:
Str
=>
Try
({}, [
StderrErr
(
IOErr
)])
Stderr
.
write_bytes!
:
List
(
U8
)
=>
Try
({}, [
StderrErr
(
IOErr
)])
Stdin
.
line!
: ()
=>
Try
(
Str
, [
EndOfInput
,
BadUtf8
({ problem :
Utf8Problem
, index :
U64
}),
StdinErr
(
IOErr
)])
Stdin
.
bytes!
: ()
=>
Try
(
List
(
U8
), [
EndOfInput
,
StdinErr
(
IOErr
)])
Stdin
.
read_to_end!
: ()
=>
Try
(
List
(
U8
), [
StdinErr
(
IOErr
)])
Stdin
.
lines
: ()
->
Stream
(
Try
(
Str
, [
BadUtf8
({ problem :
Utf8Problem
, index :
U64
}),
StdinErr
(
IOErr
)]))
Stdin
.
chunks
: ()
->
Stream
(
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
.
listen!
:
Str
,
U16
,
Duration
=>
Try
(
Listener
, [
TcpErr
(
IOErr
)])
Tcp
.
connect!
:
Str
,
U16
, { connect_timeout :
Duration
, io_timeout :
Duration
}
=>
Try
(
Connection
, [
TcpErr
(
IOErr
)])
Tcp
.
Listener
Tcp.Listener
.
to_inspect
:
Listener
->
Str
Tcp.Listener
.
local_port!
:
Listener
=>
Try
(
U16
, [
Closed
,
TcpErr
(
IOErr
)])
Tcp.Listener
.
accept!
:
Listener
, { accept_timeout : [
NoTimeout
,
After
(
Duration
)], io_timeout :
Duration
}
=>
Try
(
Connection
, [
Closed
,
TcpErr
(
IOErr
)])
Tcp.Listener
.
close!
:
Listener
=>
Try
({}, [
TcpErr
(
IOErr
)])
Tcp
.
Connection
Tcp.Connection
.
to_inspect
:
Connection
->
Str
Tcp.Connection
.
with_timeout
:
Connection
,
Duration
->
Connection
Tcp.Connection
.
with_line_limit
:
Connection
,
U64
->
Connection
Tcp.Connection
.
read_up_to!
:
Connection
,
U64
=>
Try
(
List
(
U8
), [
EndOfInput
,
TcpErr
(
IOErr
)])
Tcp.Connection
.
read_exactly!
:
Connection
,
U64
=>
Try
(
List
(
U8
), [
UnexpectedEndOfInput
,
TcpErr
(
IOErr
)])
Tcp.Connection
.
read_until!
:
Connection
,
U8
=>
Try
(
List
(
U8
), [
EndOfInput
,
ReadLimitExceeded
(
U64
),
TcpErr
(
IOErr
)])
Tcp.Connection
.
read_line!
:
Connection
=>
Try
(
Str
, [
EndOfInput
,
ReadLimitExceeded
(
U64
),
BadUtf8
({ problem :
Utf8Problem
, index :
U64
}),
TcpErr
(
IOErr
)])
Tcp.Connection
.
write_bytes!
:
Connection
,
List
(
U8
)
=>
Try
({}, [
TcpErr
(
IOErr
)])
Tcp.Connection
.
write_utf8!
:
Connection
,
Str
=>
Try
({}, [
TcpErr
(
IOErr
)])
Tcp.Connection
.
chunks
:
Connection
->
Stream
(
Try
(
List
(
U8
), [
TcpErr
(
IOErr
)]))
Tcp.Connection
.
lines
:
Connection
->
Stream
(
Try
(
Str
, [
ReadLimitExceeded
(
U64
),
BadUtf8
({ problem :
Utf8Problem
, index :
U64
}),
TcpErr
(
IOErr
)]))
Tty
.
enable_raw_mode!
: ()
=>
Try
({}, [
TtyErr
(
IOErr
)])
Tty
.
disable_raw_mode!
: ()
=>
Try
({}, [
TtyErr
(
IOErr
)])
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!
: ()
=>
Utc
Utc
.
from_nanos_since_epoch
:
I128
->
Utc
Utc
.
to_nanos_since_epoch
:
Utc
->
I128
Utc
.
from_millis_since_epoch
:
I128
->
Utc
Utc
.
to_millis_since_epoch
:
Utc
->
I128
Utc
.
since
:
Utc
,
Utc
->
Duration
Utc
.
to_iso_8601
:
Utc
->
Str
Utc
.
to_inspect
:
Utc
->
Str
Utc
.
is_eq
: _
Utc
.
is_lt
:
Utc
,
Utc
->
Bool
Utc
.
is_lte
:
Utc
,
Utc
->
Bool
Utc
.
is_gt
:
Utc
,
Utc
->
Bool
Utc
.
is_gte
:
Utc
,
Utc
->
Bool
Utc
.
order_relative_to
:
Utc
,
Utc
->
[
Before
,
Same
,
After
]