Pure-Rust asynchronous SSH library, both client and server

#63 ENHANCEMENT: thrussh::server::Session should implement std::fmt::Debug

Opened by fschuetz on January 13, 2022
fschuetz on January 13, 2022

thrussh types should implement the Debug trait, especially to allow for easy use of tracing annotation.

    #[instrument]
    fn data(mut self, _channel: ChannelId, data: &[u8], session: server::Session) -> Self::FutureUnit { 
     .....

will not compile because Session does not implement Debug

error[E0277]: `thrussh::server::Session` doesn't implement `std::fmt::Debug`
   --> src/connection_manager/ssh_server.rs:105:5
    |
105 |     #[instrument]
    |     ^^^^^^^^^^^^^ `thrussh::server::Session` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `thrussh::server::Session`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&thrussh::server::Session`
note: required by a bound in `debug`
   --> /Users/fschuetz/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-core-0.1.21/src/field.rs:265:8
    |
265 |     T: fmt::Debug,
    |        ^^^^^^^^^^ required by this bound in `debug`
    = note: this error originates in the attribute macro `instrument` (in Nightly builds, run with -Z macro-backtrace for more info)