View Source Lexical.Document.Store (lexical_shared v0.5.0)
Backing store for source file documents.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Link to this section Types
@type derivation() :: {derivation_key(), derivation_fun()}
@type derivation_fun() :: (Lexical.Document.t() -> derived_value())
@type derivation_key() :: atom()
@type derivations() :: [derivation()]
@type derived_value() :: any()
@type start_opt() :: {:derive, derivations()}
@type start_opts() :: [start_opt()]
@type updater() :: (Lexical.Document.t() -> {:ok, Lexical.Document.t()} | {:error, any()})
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec close(Lexical.uri()) :: :ok | {:error, :not_open}
@spec fetch(Lexical.uri()) :: {:ok, Lexical.Document.t()} | {:error, :not_open}
@spec fetch(Lexical.uri(), derivation_key()) :: {:ok, Lexical.Document.t(), derived_value()} | {:error, :not_open}
@spec get_and_update(Lexical.uri(), updater()) :: {:ok, Lexical.Document.t()} | {:error, any()}
@spec open(Lexical.uri(), String.t(), pos_integer()) :: :ok | {:error, :already_open}
@spec open?(Lexical.uri()) :: boolean()
@spec open_temporary(Lexical.uri() | Path.t(), timeout()) :: {:ok, Lexical.Document.t()} | {:error, term()}
@spec save(Lexical.uri()) :: :ok | {:error, :not_open}
@spec start_link(start_opts()) :: GenServer.on_start()
@spec update(Lexical.uri(), updater()) :: :ok | {:error, any()}