use std::future::Future;
use std::pin::Pin;

use warp::Filter;

#[tokio::main]
async fn main() {
    let app = warp::path::end().map(|| "TODO: learn how to use this");

    warp::serve(app).run(([127,0,0,1], 3030)).await;
}

struct TTPServer {
}

struct TTPSyncHandler {
}

enum TTPSyncError {
    Inherited(thrussh::Error),
}

impl thrussh::server::Server for TTPServer {
    type Handler = TTPSyncHandler;

    fn new(&mut self, peer_addr: Option<std::net::SocketAddr>) -> Self::Handler {
        TTPSyncHandler {}
    }
}

impl From<thrussh::Error> for TTPSyncError {
    fn from(value: thrussh::Error) -> Self {
        Self::Inherited(value)
    }
}

impl thrussh::server::Handler for TTPSyncHandler {
    type Error = TTPSyncError;
    type FutureAuth = Pin<Box<dyn Future<Output=Result<(Self, thrussh::server::Auth), Self::Error>> + Send>>;
    type FutureUnit = Pin<Box<dyn Future<Output=Result<(Self, thrussh::server::Session), Self::Error>> + Send>>;
    type FutureBool = Pin<Box<dyn Future<Output=Result<(Self, thrussh::server::Session, bool), Self::Error>> + Send>>;

    fn finished_auth(self, _auth: thrussh::server::Auth) -> Self::FutureAuth {
        todo!()
    }

    fn finished_bool(self, _b: bool, _session: thrussh::server::Session) -> Self::FutureBool {
        todo!()
    }

    fn finished(self, _session: thrussh::server::Session) -> Self::FutureUnit {
        todo!()
    }
}