Skip to content

Commit 2ae1bdd

Browse files
Merge pull request #649 from swimos/docs5
Tidy up of crate/module API: Stage 5
2 parents 2d5c5f0 + 037b263 commit 2ae1bdd

File tree

126 files changed

+1419
-3596
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+1419
-3596
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ members = [
77
"api/formats/swimos_*",
88
"macro_utilities",
99
"runtime/swimos_*",
10-
"swimos_store",
1110
"swimos_utilities",
1211
"swimos_utilities/swimos_*",
1312
"swimos_downlink",

api/swimos_api/src/error/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,8 @@ pub enum DownlinkFailureReason {
8383
UnresolvableLocal(RelativeAddress<Text>),
8484
#[error("Connection to the remote host failed: {0}")]
8585
ConnectionFailed(Arc<std::io::Error>),
86-
#[error("Failed to negotiate a TLS connection: {error}")]
87-
TlsConnectionFailed {
88-
error: Arc<dyn std::error::Error + Send + Sync>,
89-
recoverable: bool,
90-
},
86+
#[error("Failed to negotiate a TLS connection: {message}")]
87+
TlsConnectionFailed { message: String, recoverable: bool },
9188
#[error("Could not negotiate a websocket connection: {0}")]
9289
WebsocketNegotiationFailed(String),
9390
#[error("The remote client stopped while the downlink was starting.")]

api/swimos_api/src/persistence.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,17 @@ impl PlanePersistence for StoreDisabled {
153153
ready(Ok(StoreDisabled)).boxed()
154154
}
155155
}
156+
157+
pub trait ServerPersistence {
158+
type PlaneStore: PlanePersistence + Clone + Send + Sync + 'static;
159+
160+
fn open_plane(&self, name: &str) -> Result<Self::PlaneStore, StoreError>;
161+
}
162+
163+
impl ServerPersistence for StoreDisabled {
164+
type PlaneStore = StoreDisabled;
165+
166+
fn open_plane(&self, _name: &str) -> Result<Self::PlaneStore, StoreError> {
167+
Ok(Self)
168+
}
169+
}

api/swimos_form/src/structural/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use std::str::FromStr;
3636
/// use swimos_form::Form;
3737
/// use swimos_form::Tag;
3838
/// use swimos_model::{Attr, Item, Value};
39-
/// use swimos_model::time::Timestamp;
39+
/// use swimos_model::Timestamp;
4040
///
4141
/// #[derive(Tag, Clone)]
4242
/// #

client/fixture/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
[dependencies]
77
swimos_runtime = { path = "../../runtime/swimos_runtime" }
88
swimos_remote = { path = "../../runtime/swimos_remote" }
9-
swimos_net = { path = "../../runtime/swimos_net" }
9+
swimos_messages = { path = "../../runtime/swimos_messages" }
1010
swimos_api = { path = "../../api/swimos_api" }
1111
ratchet = { features = ["deflate", "split"], workspace = true }
1212
swimos_recon = { path = "../../api/formats/swimos_recon" }

client/fixture/src/lib.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,15 @@ use std::net::SocketAddr;
1414
use std::ops::DerefMut;
1515
use std::sync::Arc;
1616
use swimos_form::Form;
17+
use swimos_messages::remote_protocol::FindNode;
1718
use swimos_model::{Text, Value};
18-
use swimos_net::Scheme;
1919
use swimos_recon::parser::parse_recognize;
2020
use swimos_recon::print_recon;
21-
use swimos_remote::net::dns::{BoxDnsResolver, DnsResolver};
22-
use swimos_remote::net::{
23-
ClientConnections, ConnResult, ConnectionError, IoResult, Listener, ListenerError,
21+
use swimos_remote::dns::{BoxDnsResolver, DnsResolver};
22+
use swimos_remote::websocket::{RatchetError, WebsocketClient, WebsocketServer, WsOpenFuture};
23+
use swimos_remote::{
24+
ClientConnections, ConnectionError, ConnectionResult, Listener, ListenerError, Scheme,
2425
};
25-
use swimos_remote::ws::{RatchetError, WebsocketClient, WebsocketServer, WsOpenFuture};
26-
use swimos_remote::FindNode;
2726
use tokio::io::{AsyncRead, AsyncWrite, DuplexStream};
2827
use tokio::sync::mpsc;
2928
use tokio::sync::Mutex;
@@ -72,7 +71,7 @@ impl ClientConnections for MockClientConnections {
7271
_scheme: Scheme,
7372
_host: Option<&str>,
7473
addr: SocketAddr,
75-
) -> BoxFuture<'_, ConnResult<Self::ClientSocket>> {
74+
) -> BoxFuture<'_, ConnectionResult<Self::ClientSocket>> {
7675
async move {
7776
self.inner
7877
.lock()
@@ -88,7 +87,11 @@ impl ClientConnections for MockClientConnections {
8887
Box::new(self.clone())
8988
}
9089

91-
fn lookup(&self, host: String, port: u16) -> BoxFuture<'static, IoResult<Vec<SocketAddr>>> {
90+
fn lookup(
91+
&self,
92+
host: String,
93+
port: u16,
94+
) -> BoxFuture<'static, std::io::Result<Vec<SocketAddr>>> {
9295
self.resolve(host, port).boxed()
9396
}
9497
}

client/runtime/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ swimos_form = { path = "../../api/swimos_form" }
1919
swimos_utilities = { path = "../../swimos_utilities", features = ["buf_channel", "trigger", "algebra"] }
2020
swimos_runtime = { path = "../../runtime/swimos_runtime" }
2121
swimos_remote = { path = "../../runtime/swimos_remote" }
22-
swimos_net = { path = "../../runtime/swimos_net" }
2322
swimos_messages = { path = "../../runtime/swimos_messages" }
2423
ratchet = { features = ["deflate", "split"], workspace = true }
2524
futures = { workspace = true }

client/runtime/src/commander/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ use ratchet::{
2121
CloseCode, CloseReason, NoExt, NoExtProvider, ProtocolRegistry, WebSocket, WebSocketConfig,
2222
};
2323
use swimos_form::write::StructuralWritable;
24-
use swimos_net::{BadUrl, SchemeHostPort};
2524
use swimos_recon::print_recon_compact;
25+
use swimos_remote::{BadWarpUrl, SchemeHostPort};
2626
use thiserror::Error;
2727
use tokio::net::TcpStream;
2828

@@ -31,7 +31,7 @@ pub enum CommandError {
3131
#[error("Failed to send command: {0}")]
3232
Ratchet(#[from] ratchet::Error),
3333
#[error("Invalid URL: {0}")]
34-
Url(#[from] BadUrl),
34+
Url(#[from] BadWarpUrl),
3535
}
3636

3737
impl From<std::io::Error> for CommandError {

client/runtime/src/models.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ use fnv::FnvHashMap;
1616
use std::fmt::{Display, Formatter};
1717
use std::future::Future;
1818
use swimos_api::{address::RelativeAddress, agent::DownlinkKind};
19+
use swimos_messages::remote_protocol::AttachClient;
1920
use swimos_model::Text;
20-
use swimos_remote::AttachClient;
2121
use swimos_runtime::downlink::failure::{
2222
AlwaysAbortStrategy, AlwaysIgnoreStrategy, ReportStrategy,
2323
};

client/runtime/src/pending.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ use std::pin::Pin;
2424
use std::task::{Context, Poll};
2525
use swimos_api::address::RelativeAddress;
2626
use swimos_client_api::DownlinkConfig;
27+
use swimos_messages::remote_protocol::AttachClient;
2728
use swimos_model::Text;
28-
use swimos_net::Scheme;
29-
use swimos_remote::AttachClient;
29+
use swimos_remote::Scheme;
3030
use swimos_runtime::downlink::{DownlinkOptions, DownlinkRuntimeConfig};
3131
use tokio::sync::mpsc;
3232

0 commit comments

Comments
 (0)