Skip to main content

Crate xoq

Crate xoq 

Source
Expand description

xoq - X-Embodiment over QUIC

A library for building P2P and relay-based communication using either MoQ (Media over QUIC) or iroh for direct peer-to-peer connections.

§Examples

§MoQ (via relay)

use xoq::moq::MoqBuilder;

// Simple anonymous connection
let mut conn = MoqBuilder::new()
    .path("anon/my-channel")
    .connect_duplex()
    .await?;

// With authentication
let mut conn = MoqBuilder::new()
    .path("secure/my-channel")
    .token("your-jwt-token")
    .connect_duplex()
    .await?;

§Iroh (P2P)

use xoq::iroh::{IrohServerBuilder, IrohClientBuilder};

// Server with persistent identity
let server = IrohServerBuilder::new()
    .identity_path(".my_server_key")
    .bind()
    .await?;
println!("Server ID: {}", server.id());

// Client connecting to server
let conn = IrohClientBuilder::new()
    .connect_str("server-endpoint-id-here")
    .await?;

Re-exports§

pub use moq::MoqBuilder;
pub use moq::MoqConnection;
pub use moq::MoqPublisher;
pub use moq::MoqStream;
pub use moq::MoqSubscriber;
pub use moq::MoqTrackReader;
pub use moq::MoqTrackWriter;
pub use can_types::wire as can_wire;
pub use can_types::AnyCanFrame;
pub use can_types::CanBusSocket;
pub use can_types::CanFdFlags;
pub use can_types::CanFdFrame;
pub use can_types::CanFrame;
pub use can_types::CanInterfaceInfo;
pub use moq_token;

Modules§

arm_dynamics
Rigid-body arm dynamics for gravity simulation.
can_types
Platform-independent CAN bus types and traits.
cmaf
Platform-independent CMAF (Common Media Application Format) muxer for H.264 and AV1 video streams.
moq
MoQ transport builder