Current section

Files

Jump to
touch_grass src touch_grass@file_system@delete_file.erl
Raw

src/touch_grass@file_system@delete_file.erl

-module(touch_grass@file_system@delete_file).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/touch_grass/file_system/delete_file.gleam").
-export([decode/1, encode/1]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
?MODULEDOC(
" Delete a file at the given path.\n"
"\n"
" Deleting a file that does not exist is an error, surfaced via the\n"
" `Result` return type.\n"
).
-file("src/touch_grass/file_system/delete_file.gleam", 9).
-spec decode(eyg@interpreter@value:value(QBI, QBJ)) -> {ok, binary()} |
{error, eyg@interpreter@break:reason(QBI, QBJ)}.
decode(Input) ->
eyg@interpreter@cast:as_string(Input).
-file("src/touch_grass/file_system/delete_file.gleam", 13).
-spec encode({ok, nil} | {error, binary()}) -> eyg@interpreter@value:value(any(), any()).
encode(Result) ->
case Result of
{ok, nil} ->
eyg@interpreter@value:ok(eyg@interpreter@value:unit());
{error, Reason} ->
eyg@interpreter@value:error({string, Reason})
end.