Expand description
Convenience re-exports for the socket module.
Importing this prelude brings the most commonly used server and client
types into scope through a single use path:
use toolkit_zero::socket::prelude::*;
// Server types — fluent builder
let mut server = Server::default();
server.mechanism(ServerMechanism::get("/health").onconnect(|| async { reply!() }));
// Server types — attribute macro shorthand
#[mechanism(server, GET, "/hello")]
async fn hello() { reply!() }
// Client types
let client = Client::new(Target::Localhost(8080));Re-exports are gated by feature flags:
socket-server/socket:Server,ServerMechanism,Status,mechanismsocket-client/socket:Client,ClientError,Target,request- always available:
SerializationKey
Re-exports§
pub use crate::socket::SerializationKey;pub use crate::socket::server::Server;pub use crate::socket::server::ServerMechanism;pub use crate::socket::server::Status;pub use crate::socket::client::Client;pub use crate::socket::client::ClientError;pub use crate::socket::client::Target;