User Manual

Rust Data Source User Guide

8/7/26
Rust Data Source User Guide

The Rust data source is one of the integration methods available on the Kuika platform that allows you to develop custom functions and business logic. Using Rust, you can define custom operations within your application, create functions that accept parameters, and use these functions in application workflows.

With the Rust data source, you can write custom code to address needs beyond the built-in actions, customize data processing workflows, and create reusable functions.

You may need to have an appropriate subscription plan to use the Rust data source feature. You can upgrade your subscription to access more advanced development tools.

Add a Data Source Connection to Your App with Rust

  1. Log in to the Kuika platform and open the project you’ll be working on from the Apps screen.
  2. Open the Data Sources module.
    • Here, you can view existing data sources and add a new one.
  3. In the left panel, click the + icon next to the Sources heading.
  4. On the Add a new Datasource screen that opens, select the Rust option under the Development category.
  5. Enter a name for your data source.
  6. Click the CREATE button to complete the process.

Anatomy of the Rust Action Modal

A. Top Menu

  • Title (Rust Action): The modal’s title indicates that the created data source is a Rust-based action.
  • CREATE Button: Used to save the Rust data source you’ve created.
  • Close Button (X): Used to close the screen and exit the process.

B. Top Settings Area

  • Name: A field where you can enter a description of what your function does. This helps other developers—or even you in the future—remember the purpose of the code.
  • External Libraries (BETA): This section allows you to add external crates (dependencies) to use in your Rust code. It is currently labeled BETA.
  • Generate with AI: This option is used to automatically generate Rust code with AI support. When enabled, you can receive code suggestions from the system.

C. Rust Editor

  • This is the code editing area.
  • All custom functions are defined here.
  • Default example structure:
pub fn greet(name: String) -> String {
  format!("Hello, {}", name)
}

This structure demonstrates the following:

  • Functions are defined using the `pub fn` keywords (marked as externally accessible/public).
  • They can accept parameters.
  • The parameter type can be specified (e.g., `String`).
  • The return type can be defined using the `->` symbol (e.g., `String`).
  • In the function body, the `format!` macro can be used to generate formatted text.

D. TIDY UP Button

  • Located in the upper-right corner of the code editor.
  • It is used to edit, indent, and make the written code more readable.

E. Test Console

  • This area, located at the bottom of the screen, is used to test the functions you’ve written.
  • In this section:
    • The function list is displayed.
    • Parameter input fields are provided.
    • The result output can be viewed.

Configuring Rust Data Source Settings

Manual Code Writing

If “Generate with AI” is turned off, all code is written manually directly in the editor.

Example:

pub fn to_upper_case(text: String) -> String {
  text.to_uppercase()
}

Code Generation with AI

If you enable the “Generate with AI” feature, you can create code automatically by writing a description.

Example command:

Create a function that converts the entered text to uppercase.

Using External Libraries (BETA)

Through the External Libraries section, you can include additional crates in your project beyond the standard Rust libraries (std). This feature is currently in the BETA phase.

Defining Parameters

You can add parameters to your functions.

Example:

pub fn sum(value1: f64, value2: f64) -> f64 {
  value1 + value2
}

This function takes two numbers and returns their sum.

Specifying the Return Type

The return type must be specified at the end of the function signature using the -> symbol.

Example types:

  • String
  • i32 / i64
  • f64
  • bool
  • Vec<T> (array/list)
  • Option<T>

Testing Functions with the Test Console

After writing your code, you can use the Test Console section below.

  1. Select the function you want to test.
  2. Enter sample data into the parameter fields.
  3. Run the function.
  4. Check the return result.

Example:

pub fn hello(name: String) -> String {
  format!("Hello {}", name)
}

Parameter: Kuika Expected output: Hello Kuika

Saving the Data Source with CREATE

After completing and testing your code, you can save the Rust data source by clicking the CREATE button. The saved data source becomes available for use within the application.

Expected Output / Result

Once these steps are complete:

  • The Rust data source is added to the Sources list.
  • The defined functions become available for use in the system.
  • Custom business rules can be managed via code.
  • A reusable function structure is created.
No items found.

Other Related Content

No items found.

Glossary

No items found.

Alt Başlıklar