@@ -79,17 +79,17 @@ pub struct Sender<D, E = std::convert::Infallible> {
79
79
80
80
impl < D , E > Sender < D , E > {
81
81
/// Send a frame on the channel.
82
- pub async fn send ( & self , frame : Frame < D > ) -> Result < ( ) , SendError > {
82
+ pub async fn send ( & mut self , frame : Frame < D > ) -> Result < ( ) , SendError > {
83
83
self . tx_frame . send ( frame) . await . map_err ( |_| SendError )
84
84
}
85
85
86
86
/// Send data on data channel.
87
- pub async fn send_data ( & self , buf : D ) -> Result < ( ) , SendError > {
87
+ pub async fn send_data ( & mut self , buf : D ) -> Result < ( ) , SendError > {
88
88
self . send ( Frame :: data ( buf) ) . await
89
89
}
90
90
91
91
/// Send trailers on trailers channel.
92
- pub async fn send_trailers ( & self , trailers : HeaderMap ) -> Result < ( ) , SendError > {
92
+ pub async fn send_trailers ( & mut self , trailers : HeaderMap ) -> Result < ( ) , SendError > {
93
93
self . send ( Frame :: trailers ( trailers) ) . await
94
94
}
95
95
@@ -132,7 +132,7 @@ mod tests {
132
132
133
133
#[ tokio:: test]
134
134
async fn works ( ) {
135
- let ( tx, body) = Channel :: < Bytes > :: new ( 1024 ) ;
135
+ let ( mut tx, body) = Channel :: < Bytes > :: new ( 1024 ) ;
136
136
137
137
tokio:: spawn ( async move {
138
138
tx. send_data ( Bytes :: from ( "Hel" ) ) . await . unwrap ( ) ;
0 commit comments