librecast

Crates.iolibrecast
lib.rslibrecast
version1.0.1
created_at2025-06-20 07:47:52.314259+00
updated_at2025-06-20 16:34:32.831727+00
descriptionRust bindings for the librecast library
homepage
repositoryhttps://codeberg.org/ghenry/librecast-rs.git
max_upload_size
id1719251
size82,802
Gavin Henry (ghenry)

documentation

https://docs.rs/librecast

README

Rust bindings to the librecast C library via librecast-sys

Stability: Active Crates.io Docs.rs

Usage

To use librecast, run cargo add librecast like normal, then use it like so:

use librecast::Librecast;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create a new librecast context
    let librecast = Librecast::new()?;

    // Create a channel using the builder pattern
    let channel = librecast.channel_builder()
        .channel_builder()
        .name("test_channel")
        .enable_rapterq()
        .build()?;

    // Join the channel
    channel.join()?;

    // Send a message
    let message = b"Hello, world!";
    channel.send(message)?;

    // Leave the channel
    channel.leave()?;

    Ok(())
}

Examples

Run this first to start a receiver that listens for messages:

cargo run --example receiver

Then run this to send messages to the receiver, in a separate terminal:

cargo run --example sender

License

This project is licensed under the GPL-2.0-only or GPL-3.0-only license, at your option.

Commit count: 0

cargo fmt