1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// =============================================================================
// Copyright (c) 2026 Haixing Hu.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0.
// =============================================================================
//! Executes prepared writes without discarding recovery ownership on failure.
use AsyncFileSystem;
use WriteOutcome;
use Path;
use WriteOptions;
use crateContractAsyncWriteFailure;
/// Executes a prepared whole-file write while retaining its recovery operation
/// when execution fails.
///
/// Admission failures are returned without an operation because no write
/// session was created. Execution failures retain the operation, including
/// any recovery writer, in [`ContractAsyncWriteFailure`].
///
/// # Parameters
///
/// - `filesystem`: filesystem that admits and executes the write.
/// - `path`: destination path for the complete byte buffer.
/// - `bytes`: contents to publish at the destination.
/// - `options`: write disposition and other write policy.
///
/// # Returns
///
/// The write outcome when execution succeeds; otherwise, the failure snapshot
/// and any admitted operation needed for recovery.
///
/// # Errors
///
/// Returns [`ContractAsyncWriteFailure`] if admission or execution fails.
pub async