#[derive(Clone, Default)]
pub struct ReceiverContext {
_phantom: std::marker::PhantomData<()>,
}
impl ReceiverContext {
pub fn new() -> Self {
Self {
_phantom: std::marker::PhantomData,
}
}
pub fn has_di_context(&self) -> bool {
false
}
}
impl std::fmt::Debug for ReceiverContext {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("ReceiverContext")
.field("has_di_context", &false)
.finish()
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_receiver_context_new() {
let ctx = ReceiverContext::new();
assert!(!ctx.has_di_context());
}
#[test]
fn test_receiver_context_default() {
let ctx = ReceiverContext::default();
assert!(!ctx.has_di_context());
}
#[test]
fn test_receiver_context_debug() {
let ctx = ReceiverContext::new();
let debug_str = format!("{:?}", ctx);
assert!(debug_str.contains("ReceiverContext"));
assert!(debug_str.contains("has_di_context"));
}
}