Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ tokio = { version = "1", default-features = false, features = ["net", "signal",
futures = "0.3"
async-trait = "0.1"
bytes = "1"
log = "0.4"

[lints.clippy]
pedantic = "warn"
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ WireframeServer::new(|| {
This example showcases how derive macros and the framing abstraction simplify a
binary protocol server【F:docs/rust-binary-router-library-design.md†L1120-L1150】.

## Current Limitations

Connection processing is not implemented yet. After the optional
preamble is read, the server logs a warning and immediately closes the
stream. Release builds fail to compile to prevent accidental production
use.

## Roadmap

Development priorities are tracked in [docs/roadmap.md](docs/roadmap.md). Key
Expand Down
10 changes: 7 additions & 3 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,17 @@ impl WireframeApp {

/// Handle an accepted connection.
///
/// This placeholder simply drops the stream. Future implementations
/// will decode frames and dispatch them to registered handlers.
/// This placeholder immediately closes the connection after the
/// preamble phase. A warning is logged so tests and callers are
/// aware of the current limitation.
pub async fn handle_connection<S>(&self, _stream: S)
where
S: tokio::io::AsyncRead + tokio::io::AsyncWrite + Send + Unpin + 'static,
{
// Connection handling will be implemented later.
log::warn!(
"`WireframeApp::handle_connection` called, but connection handling \
is not implemented; closing stream"
);
tokio::task::yield_now().await;
}
}
10 changes: 9 additions & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
use std::io;

#[cfg(not(debug_assertions))]
compile_error!(
"`wireframe` server functionality is experimental and not intended for production use"
);
use std::net::{SocketAddr, TcpListener as StdTcpListener};
use std::sync::Arc;

Expand Down Expand Up @@ -86,7 +91,10 @@ where
///
/// # Examples
///
/// ```
/// ```ignore
/// # use wireframe::server::WireframeServer;
/// # let factory = || todo!();
/// # struct MyPreamble;
/// let server = WireframeServer::new(factory).with_preamble::<MyPreamble>();
/// ```
#[must_use]
Expand Down