Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/#20 telnet trait #24

Merged
merged 7 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions judge-control-app/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mod custom_file;
mod telnet;

fn main() {
println!("Hello, world!");
Expand Down
1 change: 1 addition & 0 deletions judge-control-app/src/telnet.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod traits;
8 changes: 8 additions & 0 deletions judge-control-app/src/telnet/traits.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use anyhow::Result;
use std::future::Future;
use std::net::ToSocketAddrs;

pub trait Telnet {
fn new<Addr: ToSocketAddrs>(addr: Addr) -> Self;
fn exec(&mut self, cmd: &str) -> impl Future<Output = Result<String>>;
}