FileWriteError
Preserves both primary whole-file transfer and secondary close failures. Reason retains the proven transferred byte prefix. CleanupError is populated only when close also fails after an earlier transfer failure; successful writes followed by close failure use close as Reason instead. No rollback is implied. This record owns reasons, allocates nothing and retains no file/input view.
Module std.fs
import std.fs;Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.
FileWriteError
pub struct FileWriteErrorPreserves both primary whole-file transfer and secondary close failures. Reason retains the proven transferred byte prefix. CleanupError is populated only when close also fails after an earlier transfer failure; successful writes followed by close failure use close as Reason instead. No rollback is implied. This record owns reasons, allocates nothing and retains no file/input view.
FileWriteError.Reason
pub Reason: IoError;Primary portable open/transfer/close failure.
FileWriteError.CleanupError
pub CleanupError: IoError?;Optional secondary close failure.
FileWriteError.Create
pub static fn Create(Reason: IoError, CleanupError: IoError?) -> FileWriteErrorCopies exact failure identities without allocation. Reason: Primary failure. CleanupError: Optional secondary close failure. Return: Independent Data failure record without retained storage.
FileWriteError.Create
pub static fn Create(Reason: IoError) -> FileWriteErrorSupplies the omitted secondary failure to Create. Note: Defaults: CleanupError = none. Reason: Same input, ownership and lifetime contract as the full operation. Return: Independent Data failure with no secondary close failure.