v0.43.0-beta.1
Pre-release
Pre-release
github-actions
released this
10 Feb 13:18
·
177 commits
to main
since this release
Breaking changes
Changes in the Handler
traits
859e685: refactor
Handler
trait to use mutable reference instead of owned variables (Alessandro Ricottone) #247
The Handler
traits no longer take ownership of both self
and Session
or have to return them. These have been replaced with normal &mut
references.
You will need to update your Handler
impls to match the new method signatures, for example:
async fn channel_open_session(
- self,
+ &mut self,
channel: Channel<Msg>,
- session: Session,
+ session: &mut Session,
- ) -> Result<(Self, bool, Session), Self::Error> {
+ ) -> Result<bool, Self::Error> {
...
- Ok((self, true, session))
+ Ok(true)
}
async fn auth_publickey(
- self,
+ &mut self,
_: &str,
_: &key::PublicKey,
- ) -> Result<(Self, server::Auth), Self::Error> {
+ ) -> Result<server::Auth, Self::Error> {
...
- Ok((self, server::Auth::Accept))
+ Ok(server::Auth::Accept)
}
russh::server::run
moved into the Server
trait
a592366: Move run and run_on_socket to Server trait (Alessandro Ricottone) #247
You'll need to replace the call to run
with a call to Server::run_on_address
, for example:
- russh::server::run(config, ("0.0.0.0", 2222), &mut server).await?;
+ server.run_on_address(config, ("0.0.0.0", 2222)).await?;
}