All Projects → SLMT → telnet-rs

SLMT / telnet-rs

Licence: MIT license
A simple implementation of Telnet in Rust.

Programming Languages

rust
11053 projects
shell
77523 projects

Projects that are alternatives of or similar to telnet-rs

rspark
▁▂▆▇▁▄█▁ Sparklines for Rust apps
Stars: ✭ 50 (+42.86%)
Mutual labels:  rust-library
unicode-linebreak
󠁼💔 Implementation of the Unicode Line Breaking Algorithm in Rust
Stars: ✭ 14 (-60%)
Mutual labels:  rust-library
soap-rs
SOAP client for Rust programming language
Stars: ✭ 37 (+5.71%)
Mutual labels:  rust-library
inline-c-rs
Write and execute C code inside Rust.
Stars: ✭ 121 (+245.71%)
Mutual labels:  rust-library
ArmorLib
Easily scan files for threats to security and privacy. A Rust library and command line tool. WIP.
Stars: ✭ 20 (-42.86%)
Mutual labels:  rust-library
requests-rs
Rust HTTP client library styled after awesome Python requests
Stars: ✭ 37 (+5.71%)
Mutual labels:  rust-library
mpris-rs
Idiomatic MPRIS D-Bus interface library for Rust
Stars: ✭ 37 (+5.71%)
Mutual labels:  rust-library
Curio
A Blazing Fast HTTP Client
Stars: ✭ 35 (+0%)
Mutual labels:  rust-library
healthchecks-rs
Simple Rust library to interact with healthchecks.io
Stars: ✭ 16 (-54.29%)
Mutual labels:  rust-library
ConsolePi
Raspberry Pi Based Serial Console Server, with PushBullet Notification of IP changes, Automatic VPN termination, custom menu, Power Outlet Control, and a lot more
Stars: ✭ 109 (+211.43%)
Mutual labels:  telnet
kul
A unique textual notation that can be used as both a data format and a markup language and that has powerful extensibility of both lexical syntax and semantics, and a Rust library for parsing it.
Stars: ✭ 12 (-65.71%)
Mutual labels:  rust-library
daemonize-me
Rust library to ease the task of creating daemons
Stars: ✭ 34 (-2.86%)
Mutual labels:  rust-library
DecoyMini
🐝 A highly scalable, safe, free enterprise honeypots 一款高可扩展、安全、免费的企业级蜜罐系统
Stars: ✭ 213 (+508.57%)
Mutual labels:  telnet
dupe-krill
A fast file deduplicator
Stars: ✭ 147 (+320%)
Mutual labels:  rust-library
enumset
A library for compact bit sets containing enums.
Stars: ✭ 60 (+71.43%)
Mutual labels:  rust-library
rust-cross-libs
Cross-compile the Rust standard library for custom targets without a full bootstrap build.
Stars: ✭ 29 (-17.14%)
Mutual labels:  rust-library
thread-priority
A simple thread schedule and priority library for rust
Stars: ✭ 48 (+37.14%)
Mutual labels:  rust-library
rust-pkcs11
Rust PKCS#11 Library
Stars: ✭ 70 (+100%)
Mutual labels:  rust-library
simple redis
Simple and resilient redis client for rust.
Stars: ✭ 21 (-40%)
Mutual labels:  rust-library
font8x8-rs
8x8 monochrome bitmap fonts for rendering. Implemented in Rust.
Stars: ✭ 15 (-57.14%)
Mutual labels:  rust-library

telnet-rs

Build Status MIT licensed crates.io API docs

A simple Telnet implementation.

Examples

Blocking Reading

use telnet::{Telnet, Event};

fn main() {
    let mut telnet = Telnet::connect(("ptt.cc", 23), 256)
            .expect("Couldn't connect to the server...");

    loop {
        let event = telnet.read().expect("Read error");

        if let Event::Data(buffer) = event {
            // Debug: print the data buffer
            println!("{:?}", buffer);
            // process the data buffer
        }
    }
}

Non-Blocking Reading

use telnet::{Telnet, Event};

fn main() {
    let mut telnet = Telnet::connect(("ptt.cc", 23), 256)
            .expect("Couldn't connect to the server...");

    loop {
        let event = telnet.read_nonblocking().expect("Read error");

        if let Event::Data(buffer) = event {
            // Debug: print the data buffer
            println!("{:?}", buffer);
            // process the data buffer
        }

        // Do something else ...
    }
}

Writing

use telnet::Telnet;

fn main() {
    let mut telnet = Telnet::connect(("ptt.cc", 23), 256)
            .expect("Couldn't connect to the server...");

    let buffer: [u8; 4] = [83, 76, 77, 84];
    telnet.write(&buffer).expect("Read error");
}

TODOs

  • reduce unnecessary data copy
  • add coverage check
  • add crate-level documentation
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].