Skip to content

Commit 6edfcbf

Browse files
committed
Tidies up client API and exports.
1 parent a91317f commit 6edfcbf

File tree

1 file changed

+13
-13
lines changed
  • client/swimos_client/src

1 file changed

+13
-13
lines changed

client/swimos_client/src/lib.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ use futures_util::future::BoxFuture;
2222
#[cfg(feature = "deflate")]
2323
use ratchet::deflate::{DeflateConfig, DeflateExtProvider};
2424
use runtime::{
25-
start_runtime, ClientConfig, DownlinkRuntimeError, RawHandle, RemotePath, Transport,
26-
WebSocketConfig,
25+
start_runtime, ClientConfig, DownlinkRuntimeError, RawHandle, Transport, WebSocketConfig,
2726
};
28-
pub use runtime::{CommandError, Commander};
27+
pub use runtime::{CommandError, Commander, RemotePath};
2928
use std::sync::Arc;
30-
use swimos_api::downlink::DownlinkConfig;
31-
use swimos_downlink::lifecycle::{
29+
pub use swimos_api::downlink::DownlinkConfig;
30+
pub use swimos_downlink::lifecycle::{
3231
BasicMapDownlinkLifecycle, BasicValueDownlinkLifecycle, MapDownlinkLifecycle,
3332
ValueDownlinkLifecycle,
3433
};
@@ -222,7 +221,7 @@ impl ClientHandle {
222221
///
223222
/// # Arguments
224223
/// * `path` - The path of the downlink top open.
225-
pub fn value_downlink<L, T>(
224+
pub fn value_downlink<T>(
226225
&self,
227226
path: RemotePath,
228227
) -> ValueDownlinkBuilder<'_, BasicValueDownlinkLifecycle<T>> {
@@ -240,7 +239,7 @@ impl ClientHandle {
240239
///
241240
/// # Arguments
242241
/// * `path` - The path of the downlink top open.
243-
pub fn map_downlink<L, K, V>(
242+
pub fn map_downlink<K, V>(
244243
&self,
245244
path: RemotePath,
246245
) -> MapDownlinkBuilder<'_, BasicMapDownlinkLifecycle<K, V>> {
@@ -287,19 +286,19 @@ impl<'h, L> ValueDownlinkBuilder<'h, L> {
287286
}
288287

289288
/// Sets link options for the downlink.
290-
pub fn options(&mut self, options: DownlinkOptions) -> &mut Self {
289+
pub fn options(mut self, options: DownlinkOptions) -> Self {
291290
self.options = options;
292291
self
293292
}
294293

295294
/// Sets a new downlink runtime configuration.
296-
pub fn runtime_config(&mut self, config: DownlinkRuntimeConfig) -> &mut Self {
295+
pub fn runtime_config(mut self, config: DownlinkRuntimeConfig) -> Self {
297296
self.runtime_config = config;
298297
self
299298
}
300299

301300
/// Sets a new downlink configuration.
302-
pub fn downlink_config(&mut self, config: DownlinkConfig) -> &mut Self {
301+
pub fn downlink_config(mut self, config: DownlinkConfig) -> Self {
303302
self.downlink_config = config;
304303
self
305304
}
@@ -333,6 +332,7 @@ impl<'h, L> ValueDownlinkBuilder<'h, L> {
333332
}
334333
}
335334

335+
#[derive(Debug)]
336336
pub enum ValueDownlinkOperationError {
337337
NotYetSynced,
338338
DownlinkStopped,
@@ -408,19 +408,19 @@ impl<'h, L> MapDownlinkBuilder<'h, L> {
408408
}
409409

410410
/// Sets link options for the downlink.
411-
pub fn options(&mut self, options: DownlinkOptions) -> &mut Self {
411+
pub fn options(mut self, options: DownlinkOptions) -> Self {
412412
self.options = options;
413413
self
414414
}
415415

416416
/// Sets a new downlink runtime configuration.
417-
pub fn runtime_config(&mut self, config: DownlinkRuntimeConfig) -> &mut Self {
417+
pub fn runtime_config(mut self, config: DownlinkRuntimeConfig) -> Self {
418418
self.runtime_config = config;
419419
self
420420
}
421421

422422
/// Sets a new downlink configuration.
423-
pub fn downlink_config(&mut self, config: DownlinkConfig) -> &mut Self {
423+
pub fn downlink_config(mut self, config: DownlinkConfig) -> Self {
424424
self.downlink_config = config;
425425
self
426426
}

0 commit comments

Comments
 (0)