@@ -257,7 +257,7 @@ impl Client {
257
257
258
258
/// Sends a MQTT Publish to the `EventLoop`
259
259
pub fn publish < S , V > (
260
- & mut self ,
260
+ & self ,
261
261
topic : S ,
262
262
qos : QoS ,
263
263
retain : bool ,
@@ -279,7 +279,7 @@ impl Client {
279
279
}
280
280
281
281
pub fn try_publish < S , V > (
282
- & mut self ,
282
+ & self ,
283
283
topic : S ,
284
284
qos : QoS ,
285
285
retain : bool ,
@@ -310,25 +310,21 @@ impl Client {
310
310
}
311
311
312
312
/// Sends a MQTT Subscribe to the `EventLoop`
313
- pub fn subscribe < S : Into < String > > ( & mut self , topic : S , qos : QoS ) -> Result < ( ) , ClientError > {
313
+ pub fn subscribe < S : Into < String > > ( & self , topic : S , qos : QoS ) -> Result < ( ) , ClientError > {
314
314
let subscribe = Subscribe :: new ( topic. into ( ) , qos) ;
315
315
let request = Request :: Subscribe ( subscribe) ;
316
316
self . client . request_tx . send ( request) ?;
317
317
Ok ( ( ) )
318
318
}
319
319
320
320
/// Sends a MQTT Subscribe to the `EventLoop`
321
- pub fn try_subscribe < S : Into < String > > (
322
- & mut self ,
323
- topic : S ,
324
- qos : QoS ,
325
- ) -> Result < ( ) , ClientError > {
321
+ pub fn try_subscribe < S : Into < String > > ( & self , topic : S , qos : QoS ) -> Result < ( ) , ClientError > {
326
322
self . client . try_subscribe ( topic, qos) ?;
327
323
Ok ( ( ) )
328
324
}
329
325
330
326
/// Sends a MQTT Subscribe for multiple topics to the `EventLoop`
331
- pub fn subscribe_many < T > ( & mut self , topics : T ) -> Result < ( ) , ClientError >
327
+ pub fn subscribe_many < T > ( & self , topics : T ) -> Result < ( ) , ClientError >
332
328
where
333
329
T : IntoIterator < Item = SubscribeFilter > ,
334
330
{
@@ -338,36 +334,36 @@ impl Client {
338
334
Ok ( ( ) )
339
335
}
340
336
341
- pub fn try_subscribe_many < T > ( & mut self , topics : T ) -> Result < ( ) , ClientError >
337
+ pub fn try_subscribe_many < T > ( & self , topics : T ) -> Result < ( ) , ClientError >
342
338
where
343
339
T : IntoIterator < Item = SubscribeFilter > ,
344
340
{
345
341
self . client . try_subscribe_many ( topics)
346
342
}
347
343
348
344
/// Sends a MQTT Unsubscribe to the `EventLoop`
349
- pub fn unsubscribe < S : Into < String > > ( & mut self , topic : S ) -> Result < ( ) , ClientError > {
345
+ pub fn unsubscribe < S : Into < String > > ( & self , topic : S ) -> Result < ( ) , ClientError > {
350
346
let unsubscribe = Unsubscribe :: new ( topic. into ( ) ) ;
351
347
let request = Request :: Unsubscribe ( unsubscribe) ;
352
348
self . client . request_tx . send ( request) ?;
353
349
Ok ( ( ) )
354
350
}
355
351
356
352
/// Sends a MQTT Unsubscribe to the `EventLoop`
357
- pub fn try_unsubscribe < S : Into < String > > ( & mut self , topic : S ) -> Result < ( ) , ClientError > {
353
+ pub fn try_unsubscribe < S : Into < String > > ( & self , topic : S ) -> Result < ( ) , ClientError > {
358
354
self . client . try_unsubscribe ( topic) ?;
359
355
Ok ( ( ) )
360
356
}
361
357
362
358
/// Sends a MQTT disconnect to the `EventLoop`
363
- pub fn disconnect ( & mut self ) -> Result < ( ) , ClientError > {
359
+ pub fn disconnect ( & self ) -> Result < ( ) , ClientError > {
364
360
let request = Request :: Disconnect ( Disconnect ) ;
365
361
self . client . request_tx . send ( request) ?;
366
362
Ok ( ( ) )
367
363
}
368
364
369
365
/// Sends a MQTT disconnect to the `EventLoop`
370
- pub fn try_disconnect ( & mut self ) -> Result < ( ) , ClientError > {
366
+ pub fn try_disconnect ( & self ) -> Result < ( ) , ClientError > {
371
367
self . client . try_disconnect ( ) ?;
372
368
Ok ( ( ) )
373
369
}
0 commit comments