Skip to content

Commit e0c2c2c

Browse files
committed
Top level module docs for swimos.
1 parent b444733 commit e0c2c2c

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

swimos/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ authors = ["Swim Inc. developers info@swim.ai"]
55
edition = "2021"
66

77
[features]
8-
default = ["agent"]
8+
default = []
99
all = ["server", "agent", "json"]
10-
server = ["dep:swimos_server_app"]
10+
server = ["dep:swimos_server_app", "dep:swimos_remote"]
1111
agent = ["dep:swimos_agent", "dep:swimos_agent_derive"]
1212
json = ["agent", "swimos_agent/json"]
1313

@@ -19,7 +19,7 @@ swimos_recon = { path = "../api/formats/swimos_recon" }
1919
swimos_server_app = { path = "../server/swimos_server_app", optional = true }
2020
swimos_agent = { path = "../server/swimos_agent", optional = true }
2121
swimos_agent_derive = { path = "../server/swimos_agent_derive", optional = true }
22-
swimos_remote = { path = "../runtime/swimos_remote" }
22+
swimos_remote = { path = "../runtime/swimos_remote", optional = true}
2323

2424
[dev-dependencies]
2525
parking_lot = { workspace = true }

swimos/src/lib.rs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@
1515
#[doc(inline)]
1616
pub use swimos_model as model;
1717

18-
/// Defines the low level API for implementing Swim agents.
18+
/// Defines the low level API for implementing Swim applications.
1919
pub mod api {
2020
pub use swimos_api::agent::{Agent, DownlinkKind, UplinkKind};
2121
pub use swimos_utilities::handlers::NoHandler;
2222

23+
/// Address types to refer to the location of agent instances.
2324
pub mod address {
2425
pub use swimos_api::address::{Address, RelativeAddress};
2526
}
2627

27-
/// Error
28+
/// Error types produced by implementations of the implementations of the Swim API.
2829
pub mod error {
2930
pub use swimos_api::error::{
3031
AgentInitError, AgentRuntimeError, AgentTaskError, DownlinkFailureReason,
@@ -33,6 +34,7 @@ pub mod api {
3334
};
3435
}
3536

37+
/// Defines the interface for defining Swim agent implementations.
3638
pub mod agent {
3739
pub use swimos_api::agent::{
3840
AgentConfig, AgentContext, AgentInitResult, AgentTask, BoxAgent, DownlinkKind,
@@ -44,41 +46,54 @@ pub mod api {
4446
}
4547
}
4648

47-
pub mod utilities {
49+
/// Retry strategies for processes that could fail.
50+
pub mod retry {
4851
pub use swimos_utilities::future::{Quantity, RetryStrategy};
4952
}
5053

54+
/// Descriptions of agent routes and patterns for matching against them.
5155
pub mod route {
5256
pub use swimos_utilities::routing::RouteUri;
5357
pub use swimos_utilities::routing::{ApplyError, ParseError, RoutePattern, UnapplyError};
5458
}
5559

60+
/// Channels and error types for communication between the SwimOS runtime and Swim agents.
5661
pub mod io {
62+
63+
/// Bidirectional byte channels used to communicate between the SwimOS runtime and Swim agents
64+
/// instances.
5765
pub mod channels {
5866
pub use swimos_utilities::byte_channel::{
5967
are_connected, byte_channel, ByteReader, ByteWriter,
6068
};
6169
}
70+
71+
/// Error types that can be produced when serializing and deserializing messages within the SwimOS
72+
/// runtime.
6273
pub mod errors {
6374
pub use swimos_api::error::{FrameIoError, InvalidFrame};
6475
pub use swimos_recon::parser::{AsyncParseError, ParseError};
6576
}
77+
6678
}
6779

80+
/// The core Swim server application runtime.
6881
#[cfg(feature = "server")]
6982
pub mod server {
7083
pub use swimos_server_app::{
7184
BoxServer, DeflateConfig, IntrospectionConfig, RemoteConnectionsConfig, Server,
7285
ServerBuilder, ServerHandle, WindowBits,
7386
};
7487

88+
/// Configuration for TLS support in the server.
7589
pub mod tls {
7690
pub use swimos_remote::tls::{
7791
CertChain, CertFormat, CertificateFile, ClientConfig, PrivateKey, ServerConfig,
7892
TlsConfig,
7993
};
8094
}
8195

96+
/// Error types that can be produced when initializing and executing the server.
8297
pub mod errors {
8398
pub use swimos_remote::tls::TlsError;
8499
pub use swimos_remote::ConnectionError;

0 commit comments

Comments
 (0)