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
53
54
55
// =============================================================================
// Copyright (c) 2026 Haixing Hu.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0.
// =============================================================================
// facade.
//! Facade-resolved write options.
use crate::write::WriteOptions;
/// Immutable writer options resolved by the facade before provider dispatch.
///
/// # Examples
///
/// ```rust
/// use qubit_fs::spi::ResolvedWriteOptions;
///
/// fn inspect_write_options(options: &ResolvedWriteOptions) {
/// let _caller_options = options.options();
/// }
///
/// // A provider receives this facade-created value in its write request.
/// let _ = inspect_write_options;
/// ```
#[derive(Clone)]
pub struct ResolvedWriteOptions {
/// Caller options retained after facade validation and normalization.
options: WriteOptions,
}
impl ResolvedWriteOptions {
/// Creates this value inside the facade boundary.
///
/// # Parameters
/// - `options`: Caller options after facade validation and normalization.
///
/// # Returns
/// An immutable provider-facing option envelope.
#[inline]
pub(crate) const fn new(options: WriteOptions) -> Self {
Self { options }
}
/// Returns the resolved options.
///
/// # Returns
/// The validated options retained by this envelope.
#[inline]
#[must_use]
pub const fn options(&self) -> &WriteOptions {
&self.options
}
}