pub struct TemporaryOutput { /* private fields */ }Expand description
One exclusively created temporary directory beside a destination file.
The output lives inside a private directory, so an old .aede-partial file
cannot redirect either a copy or ffmpeg. The final extension is retained for
encoder muxer selection. Dropping the object removes unfinished output.
Implementations§
Source§impl TemporaryOutput
impl TemporaryOutput
Sourcepub fn new(destination: &Path) -> Result<Self, String>
pub fn new(destination: &Path) -> Result<Self, String>
Prepares an isolated output after refusing a non-regular destination.
Call validate_destination with the chosen base before this method
when writing a path taken from a copy plan.
Sourcepub fn publish(self) -> Result<(), String>
pub fn publish(self) -> Result<(), String>
Publishes a complete file, replacing an ordinary existing target.
Use Self::publish_new unless replacement was explicitly requested.
Sourcepub fn publish_new(self) -> Result<(), String>
pub fn publish_new(self) -> Result<(), String>
Publishes a complete new file without replacing any existing target.
Creating the hard link is atomic even if a target appears after the
initial check. Filesystems without hard links are refused; an explicit
replacement can instead use Self::publish. No partial final file
is exposed and no check-then-rename fallback can destroy another file.