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
/// Creates [`Signal<str>`](crate::Signal<str>) using interpolation of runtime expressions.
///
/// You can use the same syntax for arguments as with [`std::format!`].
/// However, in places where an expression of type `T` can be specified with [`std::format!`],
/// you can specify an expression of either `T` or [`ToSignal<T>`](crate::signal::ToSignal<T>).
///
/// # Examples
///
/// ```rust
/// use sigmut::{signal_format, State};
///
/// let mut rt = sigmut::core::Runtime::new();
///
/// let a = State::new(1);
/// let b = 2;
/// let s = signal_format!("{a}, {b}");
///
/// assert_eq!(s.get(&mut rt.sc()), "1, 2");
///
/// a.set(3, rt.ac());
/// assert_eq!(s.get(&mut rt.sc()), "3, 2");
/// ```