Skip to content
This repository was archived by the owner on Jul 1, 2026. It is now read-only.

Add native Rust client for YTsaurus - #1

Open
styskin wants to merge 1 commit into
mainfrom
feature/rust-client
Open

Add native Rust client for YTsaurus#1
styskin wants to merge 1 commit into
mainfrom
feature/rust-client

Conversation

@styskin

@styskin styskin commented Jan 30, 2026

Copy link
Copy Markdown

Summary

This PR introduces a native Rust SDK for YTsaurus, providing idiomatic Rust access to YTsaurus clusters.

ytsaurus-yson crate

  • YSON binary format reader/writer with varint and zigzag encoding
  • YSON text format reader/writer
  • Full serde integration for serialization/deserialization
  • Support for all YSON types: Entity, Boolean, Int64, Uint64, Double, String, List, Map

ytsaurus-client crate

  • YtClient with builder pattern configuration
  • Cypress operations: create, remove, exists, get, set, list, copy, move, link
  • Table read/write with automatic table creation
  • Token-based authentication
  • Comprehensive error handling with YTsaurus error codes

Usage Example

use ytsaurus_client::{YtClient, YPath, NodeType, CreateNodeOptions};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = YtClient::builder()
        .proxy("localhost:8000")
        .token("your-token")
        .build()?;

    // Create a directory
    let path = YPath::new("//tmp/my_dir");
    client.create_node(&path, NodeType::Map, Some(CreateNodeOptions::recursive())).await?;

    // Set a value
    client.set_node(&path.join("key"), &"hello", None).await?;

    // Get a value
    let value: String = client.get_node(&path.join("key"), None).await?;
    println!("Value: {}", value);

    Ok(())
}

Test plan

  • 60 unit tests for YSON serialization pass
  • 17 unit tests for client functionality pass
  • 6 integration tests verified against local YTsaurus cluster:
    • test_cluster_connection - connects and reads cluster name
    • test_cypress_create_and_remove - creates and removes nodes
    • test_cypress_get_set - gets and sets values
    • test_cypress_list - lists directory children
    • test_copy_move - copies and moves nodes
    • test_table_write_read - writes and reads table rows

🤖 Generated with Claude Code

This introduces a native Rust SDK for YTsaurus with the following components:

## ytsaurus-yson crate
- YSON binary format reader/writer with varint and zigzag encoding
- YSON text format reader/writer
- Full serde integration for serialization/deserialization
- Support for all YSON types: Entity, Boolean, Int64, Uint64, Double, String, List, Map

## ytsaurus-client crate
- YtClient with builder pattern configuration
- Cypress operations: create, remove, exists, get, set, list, copy, move, link
- Table read/write with automatic table creation
- Token-based authentication
- Comprehensive error handling with YTsaurus error codes

## Testing
- 60 unit tests for YSON serialization
- 17 unit tests for client functionality
- 6 integration tests verified against local YTsaurus cluster

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@styskin

styskin commented Feb 20, 2026

Copy link
Copy Markdown
Author

What's wrong here?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants