Skip to content

Commit 53957a4

Browse files
committed
Updates client to new crate structure
1 parent ee80f79 commit 53957a4

File tree

3 files changed

+9
-23
lines changed

3 files changed

+9
-23
lines changed

client/swimos_client/Cargo.toml

Whitespace-only changes.

swimos_client/Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ version = "0.1.0"
44
edition = "2021"
55

66
[features]
7-
default = []
8-
tls = ["swimos_remote/tls"]
7+
default = ["aws_lc_rs_provider"]
98
deflate = ["ratchet/deflate"]
109
trust_dns = ["swimos_runtime/trust_dns"]
10+
ring_provider = ["swimos_remote/ring_provider"]
11+
aws_lc_rs_provider = ["swimos_remote/aws_lc_rs_provider"]
1112

1213
[dependencies]
1314
swimos_agent_protocol = { path = "../api/swimos_agent_protocol", version = "0.1.0" }
@@ -31,4 +32,5 @@ futures-util = { workspace = true }
3132
bytes = { workspace = true }
3233
tokio = { workspace = true, features = ["io-util", "sync"] }
3334
tokio-util = { workspace = true, features = ["codec"] }
34-
thiserror = { workspace = true }
35+
thiserror = { workspace = true }
36+
rustls = { workspace = true }

swimos_client/src/lib.rs

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
use std::time::Duration;
1516
use std::{marker::PhantomData, num::NonZeroUsize, sync::Arc};
1617

1718
use futures_util::future::BoxFuture;
@@ -20,13 +21,8 @@ use ratchet::{
2021
WebSocketStream,
2122
};
2223
use rustls::crypto::CryptoProvider;
23-
use tokio::{sync::mpsc, sync::mpsc::error::SendError, sync::oneshot::error::RecvError};
24-
pub use url::Url;
2524

26-
use runtime::{
27-
start_runtime, ClientConfig, DownlinkRuntimeError, RawHandle, Transport, WebSocketConfig,
28-
};
29-
pub use runtime::{CommandError, Commander, RemotePath};
25+
pub use commander::{CommandError, Commander};
3026
pub use swimos_client_api::DownlinkConfig;
3127
pub use swimos_downlink::{
3228
lifecycle::BasicEventDownlinkLifecycle, lifecycle::BasicMapDownlinkLifecycle,
@@ -38,33 +34,22 @@ use swimos_downlink::{
3834
MapValue, NotYetSyncedError, ValueDownlinkModel, ValueDownlinkSet,
3935
};
4036
use swimos_form::Form;
41-
pub use swimos_remote::tls::ClientConfig as TlsConfig;
42-
use swimos_remote::tls::TlsError;
43-
use swimos_remote::{
44-
dns::Resolver,
45-
plain::TokioPlainTextNetworking,
46-
tls::{CryptoProviderConfig, RustlsClientNetworking},
47-
websocket::RatchetClient,
48-
ClientConnections,
49-
};
5037
use swimos_remote::{
5138
dns::Resolver,
5239
plain::TokioPlainTextNetworking,
40+
tls::CryptoProviderConfig,
5341
tls::{ClientConfig as TlsConfig, RustlsClientNetworking, TlsError},
5442
websocket::RatchetClient,
5543
ClientConnections,
5644
};
5745
use swimos_runtime::downlink::{DownlinkOptions, DownlinkRuntimeConfig};
58-
use swimos_utilities::{trigger, trigger::promise};
5946
use swimos_utilities::{non_zero_usize, trigger, trigger::promise};
6047
use tokio::{sync::mpsc, sync::mpsc::error::SendError, sync::oneshot::error::RecvError};
6148
pub use url::Url;
6249

6350
pub use crate::models::RemotePath;
6451
use crate::{
65-
error::DownlinkRuntimeError,
66-
runtime::{start_runtime, RawHandle},
67-
transport::Transport,
52+
error::DownlinkRuntimeError, runtime::start_runtime, runtime::RawHandle, transport::Transport,
6853
};
6954

7055
#[cfg(test)]
@@ -79,7 +64,6 @@ mod transport;
7964

8065
pub type DownlinkOperationResult<T> = Result<T, DownlinkRuntimeError>;
8166

82-
#[derive(Default)]
8367
const DEFAULT_BUFFER_SIZE: NonZeroUsize = non_zero_usize!(32);
8468
const DEFAULT_CLOSE_TIMEOUT: Duration = Duration::from_secs(5);
8569

0 commit comments

Comments
 (0)