This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is webex-rust, an asynchronous Rust library providing a minimal interface to Webex Teams APIs. It's designed primarily for building bots but supports general API interactions.
cargo build- Build the librarycargo test- Run unit testscargo clippy- Run linter (note: very strict clippy rules enabled)cargo fmt- Format codecargo doc- Generate documentation
cargo run --example hello-world- Basic message sending examplecargo run --example auto-reply- Bot that automatically replies to messagescargo run --example adaptivecard- Demonstrates AdaptiveCard usagecargo run --example device-authentication- Shows device authentication flow
cargo test --lib- Run library tests onlycargo clippy --all-targets --all-features- Full clippy checkcargo build --all-targets- Build everything including examples
Webexstruct (src/lib.rs:92-100) - Main API client with token-based authenticationWebexEventStream(src/lib.rs:102-108) - WebSocket event stream handler for real-time eventsRestClient(src/lib.rs:247-251) - Low-level HTTP client wrapper- Types module (
src/types.rs) - All API data structures and serialization - AdaptiveCard module (
src/adaptive_card.rs) - Support for interactive cards - Auth module (
src/auth.rs) - Device authentication flows - Error module (
src/error.rs) - Comprehensive error handling
- Generic API methods:
get<T>(),list<T>(),delete<T>()work with anyGettabletype - Device registration: Automatic device setup and caching for WebSocket connections
- Message handling: Supports both direct messages and room messages with threading
- Event streaming: WebSocket-based real-time event processing with automatic reconnection
- Token-based authentication for REST API calls
- Device registration with Webex for WebSocket connections
- Mercury URL discovery for optimal WebSocket endpoint
- Automatic device cleanup and recreation as needed
- Uses Rust 1.76 toolchain (see
rust-toolchain.toml) - Very strict clippy configuration with pedantic and nursery lints enabled
- All public APIs must have documentation (
#![deny(missing_docs)]) - WebSocket connections require device registration and token authentication
- Mercury URL caching reduces API calls for device discovery