harmos_runtime/operations/
context.rs1use super::CallContext;
22use crate::Result;
23
24#[cfg(feature = "grpc")]
33pub(crate) struct Deadline(pub(crate) tokio::time::Instant);
34
35pub struct ContextMut<'a> {
36 context: &'a mut CallContext,
37}
38
39impl<'a> ContextMut<'a> {
46 pub(crate) fn new(context: &'a mut CallContext) -> Self {
47 Self { context }
48 }
49
50 pub fn insert<T: Send + Sync + 'static>(&mut self, value: T) -> Result<()> {
51 Ok(self.context.insert(value)?)
52 }
53
54 pub fn insert_portable<T: harmos_domain::operations::ContextValue>(&mut self, value: T) -> Result<()> {
55 Ok(self.context.insert_portable(value)?)
56 }
57}
58
59