aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-sync/src/channel.rs12
-rw-r--r--embassy-sync/src/pipe.rs6
2 files changed, 12 insertions, 6 deletions
diff --git a/embassy-sync/src/channel.rs b/embassy-sync/src/channel.rs
index f421af392..d6f36f53d 100644
--- a/embassy-sync/src/channel.rs
+++ b/embassy-sync/src/channel.rs
@@ -30,7 +30,6 @@ use crate::blocking_mutex::Mutex;
30use crate::waitqueue::WakerRegistration; 30use crate::waitqueue::WakerRegistration;
31 31
32/// Send-only access to a [`Channel`]. 32/// Send-only access to a [`Channel`].
33#[derive(Copy)]
34pub struct Sender<'ch, M, T, const N: usize> 33pub struct Sender<'ch, M, T, const N: usize>
35where 34where
36 M: RawMutex, 35 M: RawMutex,
@@ -47,6 +46,8 @@ where
47 } 46 }
48} 47}
49 48
49impl<'ch, M, T, const N: usize> Copy for Sender<'ch, M, T, N> where M: RawMutex {}
50
50impl<'ch, M, T, const N: usize> Sender<'ch, M, T, N> 51impl<'ch, M, T, const N: usize> Sender<'ch, M, T, N>
51where 52where
52 M: RawMutex, 53 M: RawMutex,
@@ -67,7 +68,6 @@ where
67} 68}
68 69
69/// Send-only access to a [`Channel`] without knowing channel size. 70/// Send-only access to a [`Channel`] without knowing channel size.
70#[derive(Copy)]
71pub struct DynamicSender<'ch, T> { 71pub struct DynamicSender<'ch, T> {
72 channel: &'ch dyn DynamicChannel<T>, 72 channel: &'ch dyn DynamicChannel<T>,
73} 73}
@@ -78,6 +78,8 @@ impl<'ch, T> Clone for DynamicSender<'ch, T> {
78 } 78 }
79} 79}
80 80
81impl<'ch, T> Copy for DynamicSender<'ch, T> {}
82
81impl<'ch, M, T, const N: usize> From<Sender<'ch, M, T, N>> for DynamicSender<'ch, T> 83impl<'ch, M, T, const N: usize> From<Sender<'ch, M, T, N>> for DynamicSender<'ch, T>
82where 84where
83 M: RawMutex, 85 M: RawMutex,
@@ -107,7 +109,6 @@ impl<'ch, T> DynamicSender<'ch, T> {
107} 109}
108 110
109/// Receive-only access to a [`Channel`]. 111/// Receive-only access to a [`Channel`].
110#[derive(Copy)]
111pub struct Receiver<'ch, M, T, const N: usize> 112pub struct Receiver<'ch, M, T, const N: usize>
112where 113where
113 M: RawMutex, 114 M: RawMutex,
@@ -124,6 +125,8 @@ where
124 } 125 }
125} 126}
126 127
128impl<'ch, M, T, const N: usize> Copy for Receiver<'ch, M, T, N> where M: RawMutex {}
129
127impl<'ch, M, T, const N: usize> Receiver<'ch, M, T, N> 130impl<'ch, M, T, const N: usize> Receiver<'ch, M, T, N>
128where 131where
129 M: RawMutex, 132 M: RawMutex,
@@ -144,7 +147,6 @@ where
144} 147}
145 148
146/// Receive-only access to a [`Channel`] without knowing channel size. 149/// Receive-only access to a [`Channel`] without knowing channel size.
147#[derive(Copy)]
148pub struct DynamicReceiver<'ch, T> { 150pub struct DynamicReceiver<'ch, T> {
149 channel: &'ch dyn DynamicChannel<T>, 151 channel: &'ch dyn DynamicChannel<T>,
150} 152}
@@ -155,6 +157,8 @@ impl<'ch, T> Clone for DynamicReceiver<'ch, T> {
155 } 157 }
156} 158}
157 159
160impl<'ch, T> Copy for DynamicReceiver<'ch, T> {}
161
158impl<'ch, T> DynamicReceiver<'ch, T> { 162impl<'ch, T> DynamicReceiver<'ch, T> {
159 /// Receive the next value. 163 /// Receive the next value.
160 /// 164 ///
diff --git a/embassy-sync/src/pipe.rs b/embassy-sync/src/pipe.rs
index 6e3e77b49..21d451ea6 100644
--- a/embassy-sync/src/pipe.rs
+++ b/embassy-sync/src/pipe.rs
@@ -11,7 +11,6 @@ use crate::ring_buffer::RingBuffer;
11use crate::waitqueue::WakerRegistration; 11use crate::waitqueue::WakerRegistration;
12 12
13/// Write-only access to a [`Pipe`]. 13/// Write-only access to a [`Pipe`].
14#[derive(Copy)]
15pub struct Writer<'p, M, const N: usize> 14pub struct Writer<'p, M, const N: usize>
16where 15where
17 M: RawMutex, 16 M: RawMutex,
@@ -28,6 +27,8 @@ where
28 } 27 }
29} 28}
30 29
30impl<'p, M, const N: usize> Copy for Writer<'p, M, N> where M: RawMutex {}
31
31impl<'p, M, const N: usize> Writer<'p, M, N> 32impl<'p, M, const N: usize> Writer<'p, M, N>
32where 33where
33 M: RawMutex, 34 M: RawMutex,
@@ -74,7 +75,6 @@ where
74impl<'p, M, const N: usize> Unpin for WriteFuture<'p, M, N> where M: RawMutex {} 75impl<'p, M, const N: usize> Unpin for WriteFuture<'p, M, N> where M: RawMutex {}
75 76
76/// Read-only access to a [`Pipe`]. 77/// Read-only access to a [`Pipe`].
77#[derive(Copy)]
78pub struct Reader<'p, M, const N: usize> 78pub struct Reader<'p, M, const N: usize>
79where 79where
80 M: RawMutex, 80 M: RawMutex,
@@ -91,6 +91,8 @@ where
91 } 91 }
92} 92}
93 93
94impl<'p, M, const N: usize> Copy for Reader<'p, M, N> where M: RawMutex {}
95
94impl<'p, M, const N: usize> Reader<'p, M, N> 96impl<'p, M, const N: usize> Reader<'p, M, N>
95where 97where
96 M: RawMutex, 98 M: RawMutex,