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
56
57
58
59
60
61
62
63
/* ***
*
* Harmos
*
* SPDX-License-Identifier: Apache-2.0
*
* ***
*/
/* === Modules === */
/* === Re-Exports === */
/* === Imports === */
// Standard Library Imports
// Third Party Imports
// Local Imports
use super::CallContext;
use crate::Result;
/* === Constants === */
/* === Macros === */
/* === Type Aliases === */
/* === Structs === */
#[cfg(feature = "grpc")]
pub(crate) struct Deadline(pub(crate) tokio::time::Instant);
pub struct ContextMut<'a> {
context: &'a mut CallContext,
}
/* === Enums === */
/* === Traits === */
/* === Implementations === */
impl<'a> ContextMut<'a> {
pub(crate) fn new(context: &'a mut CallContext) -> Self {
Self { context }
}
pub fn insert<T: Send + Sync + 'static>(&mut self, value: T) -> Result<()> {
Ok(self.context.insert(value)?)
}
pub fn insert_portable<T: harmos_domain::operations::ContextValue>(&mut self, value: T) -> Result<()> {
Ok(self.context.insert_portable(value)?)
}
}
/* === Public Functions === */
/* === Private Functions === */
/* === Tests === */