Serum.File (serum v1.5.1) View Source
Defines a struct representing a file to be read or written.
Fields
src
: Source pathdest
: Destination pathin_data
: Data read from a fileout_data
: Data to be written to a file
Link to this section Summary
Functions
Reads data from a file described by the given Serum.File
struct.
Writes data to a file described by the given Serum.File
struct.
Link to this section Types
Specs
t() :: %Serum.File{ dest: binary() | nil, in_data: IO.chardata() | String.Chars.t() | nil, out_data: IO.chardata() | String.Chars.t() | nil, src: binary() | nil }
Link to this section Functions
Specs
read(t()) :: Serum.Result.t(t())
Reads data from a file described by the given Serum.File
struct.
An error will be returned if src
is nil
.
Specs
write(t()) :: Serum.Result.t(t())
Writes data to a file described by the given Serum.File
struct.
An error will be returned if dest
is nil
.