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
// =============================================================================
// Copyright (c) 2026 Haixing Hu.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0.
// =============================================================================
// facade.
//! Facade-resolved read options.
use crate::read::ReadOptions;
use crate::spi::PrefixReadHint;
/// Immutable reader options resolved by the facade.
#[derive(Clone)]
pub struct ResolvedReadOptions {
options: ReadOptions,
prefix_hint: Option<PrefixReadHint>,
}
impl ResolvedReadOptions {
/// Creates resolved options without a provider optimization hint.
#[inline]
pub(crate) const fn new(options: ReadOptions) -> Self {
Self {
options,
prefix_hint: None,
}
}
/// Adds a non-binding bounded-prefix hint.
#[inline]
pub(crate) const fn with_prefix_hint(mut self, hint: PrefixReadHint) -> Self {
self.prefix_hint = Some(hint);
self
}
/// Returns the validated read options.
#[inline]
#[must_use]
pub const fn options(&self) -> &ReadOptions {
&self.options
}
/// Returns the optional prefix hint.
#[inline]
#[must_use]
pub const fn prefix_hint(&self) -> Option<PrefixReadHint> {
self.prefix_hint
}
}