Captured destination and overwrite policy for an explicit-path save.
The buffer process creates an intent before formatting starts and validates it again when the write commits. This keeps overwrite consent scoped to one target and lets persistence enforce exclusive creation when that target was absent.
Summary
Functions
Creates a non-forced intent for a destination that was absent when requested.
Creates an intent for the buffer's current file.
Creates an explicit overwrite intent for a captured destination.
Validates that an intent has a coherent policy and belongs to the committing buffer.
Types
@type expectation() :: :current_file | :absent | :any
@type origin_path() :: String.t() | nil
@type t() :: %Minga.Buffer.SaveIntent{ expectation: expectation(), origin_buffer: pid(), origin_path: origin_path(), overwrite: boolean(), target: String.t() }
Functions
@spec absent(String.t(), pid(), origin_path()) :: t()
Creates a non-forced intent for a destination that was absent when requested.
Creates an intent for the buffer's current file.
@spec overwrite(String.t(), pid(), origin_path()) :: t()
Creates an explicit overwrite intent for a captured destination.
Validates that an intent has a coherent policy and belongs to the committing buffer.