rstm_core/tail/
impl_tail_repr.rs1use super::{Tail, TailMut, TailRef};
7use rstm_state::RawState;
8
9impl<'a, Q, S> TailRef<'a, Q, S>
10where
11 Q: RawState,
12{
13 pub fn cloned(&self) -> Tail<Q, S>
15 where
16 Q: Clone,
17 S: Clone,
18 {
19 Tail {
20 direction: self.direction,
21 next_state: self.next_state.cloned(),
22 write_symbol: self.write_symbol.clone(),
23 }
24 }
25 pub fn copied(&self) -> Tail<Q, S>
27 where
28 Q: Copy,
29 S: Copy,
30 {
31 Tail {
32 direction: self.direction,
33 next_state: self.next_state.copied(),
34 write_symbol: *self.write_symbol,
35 }
36 }
37}
38
39impl<'a, Q, S> TailMut<'a, Q, S>
40where
41 Q: RawState,
42{
43 pub fn cloned(&self) -> Tail<Q, S>
45 where
46 Q: Clone,
47 S: Clone,
48 {
49 Tail {
50 direction: self.direction,
51 next_state: self.next_state.cloned(),
52 write_symbol: self.write_symbol.clone(),
53 }
54 }
55 pub fn copied(&self) -> Tail<Q, S>
57 where
58 Q: Copy,
59 S: Copy,
60 {
61 Tail {
62 direction: self.direction,
63 next_state: self.next_state.copied(),
64 write_symbol: *self.write_symbol,
65 }
66 }
67}