pinchpi_io behaviour (pinchpi v0.1.0)

Summary

Callbacks

get_stderr/1

-callback get_stderr(term()) -> binary().

get_stdout/1

-callback get_stdout(term()) -> binary().

init/1

-callback init(map()) -> term().

read_stdin/2

-callback read_stdin(non_neg_integer() | line | all, term()) -> {ok, binary() | eof, term()}.

set_stdout/2

-callback set_stdout(binary(), term()) -> term().

write_stderr/2

-callback write_stderr(binary(), term()) -> term().

write_stdout/2

-callback write_stdout(binary(), term()) -> term().

Functions

get_stderr(Mod, State)

-spec get_stderr(module(), term()) -> binary().

get_stdout(Mod, State)

-spec get_stdout(module(), term()) -> binary().

init(Mod, Opts)

-spec init(module(), map()) -> term().

read_stdin(Mod, Req, State)

-spec read_stdin(module(), non_neg_integer() | line | all, term()) -> {ok, binary() | eof, term()}.

set_stdout(Mod, Bin, State)

-spec set_stdout(module(), binary(), term()) -> term().

write_stderr(Mod, Data, State)

-spec write_stderr(module(), binary(), term()) -> term().

write_stdout(Mod, Data, State)

-spec write_stdout(module(), binary(), term()) -> term().