TeamTalk SDK for Rust is a high-level, safety-first wrapper for the BearWare.dk TeamTalk 5 SDK. It provides strict typing and a pure event-driven model for performance and reliability.
- Pure Event-Driven Architecture: Reactive model via
client.poll()with no arbitrary sleeps. - Strict Typing: Strong IDs such as
UserIdandChannelIdprevent misuse. - Dynamic Runtime Loading:
loader.rsdownloads SDK binaries when needed. - Full API Coverage: Events, audio, video, desktop, files, and administration.
- Documentation: API reference plus guides under docs.
Add this to your Cargo.toml:
[dependencies]
teamtalk = "1.2.0"For the latest development version from main:
[dependencies]
teamtalk = { git = "https://github.com/BlindMaster24/TeamTalkRust.git", branch = "main" }Quick add:
cargo add teamtalkDev install via cargo:
cargo add teamtalk --git https://github.com/BlindMaster24/TeamTalkRust.git --branch mainuse teamtalk::{Client, Event};
use teamtalk::types::ChannelId;
fn main() -> Result<(), Box<dyn std::error::Error>> {
teamtalk::init()?;
let client = Client::new()?;
client.connect("127.0.0.1", 10333, 10333, false)?;
loop {
if let Some((event, _msg)) = client.poll(100) {
match event {
Event::ConnectSuccess => {
client.login("RustBot", "guest", "guest", "TeamTalkRust");
}
Event::MySelfLoggedIn => {
client.join_channel(ChannelId(1), "");
}
Event::ConnectionLost | Event::ConnectFailed => break,
_ => {}
}
}
}
Ok(())
}use teamtalk::types::Channel;
let my_channel = Channel::builder("Music Room")
.topic("Only Rock 'n' Roll")
.max_users(50)
.build();
client.make_channel(&my_channel);let mut buf = String::with_capacity(1024);
teamtalk::utils::strings::copy_to_string(&raw_tt_str, &mut buf);- crates/teamtalk-sys: Low-level bindgen bindings to the SDK.
- crates/teamtalk: High-level Rust wrapper.
- crates/teamtalk/examples: Runnable examples.
- docs: User guides.
- Event-driven only.
- Strongly typed IDs for safety.
- Encapsulated FFI with explicit conversion.
- API reference: https://docs.rs/teamtalk
- Guides: docs
- Changelog: changelog
MIT