diff --git a/ractor_actors/Cargo.toml b/ractor_actors/Cargo.toml index 8fcbf58..6a50c82 100644 --- a/ractor_actors/Cargo.toml +++ b/ractor_actors/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ractor_actors" -version = "0.3.0" +version = "0.4.0" authors = ["Sean Lawlor"] description = "Helpful actors built with Ractor" documentation = "https://docs.rs/ractor_actors" diff --git a/ractor_actors/src/net/tcp/listener.rs b/ractor_actors/src/net/tcp/listener.rs index b1c17ea..0709bb2 100644 --- a/ractor_actors/src/net/tcp/listener.rs +++ b/ractor_actors/src/net/tcp/listener.rs @@ -50,13 +50,17 @@ where encryption: IncomingEncryptionMode, } -pub struct TcpListenerStartupArgs +/// Arguments to startup a TcpListener +pub struct ListenerStartupArgs where R: SessionAcceptor, { - port: super::NetworkPort, - encryption: IncomingEncryptionMode, - acceptor: R, + /// Port to listen on + pub port: super::NetworkPort, + /// Encryption settings for incoming sockets + pub encryption: IncomingEncryptionMode, + /// Callback module for accepted sockets + pub acceptor: R, } pub struct ListenerMessage; @@ -67,7 +71,7 @@ where R: SessionAcceptor, { type Msg = ListenerMessage; - type Arguments = TcpListenerStartupArgs; + type Arguments = ListenerStartupArgs; type State = ListenerState; async fn pre_start( diff --git a/ractor_actors/src/net/tcp/session.rs b/ractor_actors/src/net/tcp/session.rs index a6da7f2..7b4982a 100644 --- a/ractor_actors/src/net/tcp/session.rs +++ b/ractor_actors/src/net/tcp/session.rs @@ -40,8 +40,10 @@ pub struct TcpSessionStartupArguments where R: FrameReceiver, { - receiver: R, - tcp_session: NetworkStream, + /// The callback implementation for received for messages + pub receiver: R, + /// The tcp session to creat the sesson upon + pub tcp_session: NetworkStream, } /// A tcp-session management actor