View Source Serum.File (serum_md v1.6.0)

Defines a struct representing a file to be read or written.

Fields

  • src: Source path
  • dest: Destination path
  • in_data: Data read from a file
  • out_data: Data to be written to a file

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.

Types

@type 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
}

Functions

@spec 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.

@spec 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.