#operation #enums #insertion #utilities #deletion #insertion-deletion

icentral-operation

A Rust crate that defines an enum for basic operations including insertion and deletion, with essential utilities for operation management

1 unstable release

new 0.1.0 Apr 4, 2025

#13 in #deletion


Used in 4 crates

MIT/Apache

14KB

icentral-operation

Overview

The icentral-operation crate provides an enumerative representation of fundamental operations: Insertion and Deletion. Designed with simplicity and performance in mind, this library is ideal for any system that requires robust handling of these operations, such as database engines, text editors, or command-line interfaces.

Features

  • Enums for Operations: Clearly defined Insertion and Deletion operations using Rust enums.
  • Trait Implementations: Derived traits like Copy, Clone, Default, Debug, PartialEq, and Eq ensure seamless integration into applications requiring cloning and comparison of operations.
  • Utility Methods: Method implementations such as is_deletion() and is_insertion() offer quick checks on the operation types.

Usage

To employ icentral-operation in your project, add it as a dependency in your Cargo.toml:

[dependencies]
icentral-operation = "0.1.0"

Here is a simple example to get started:

use icentral_operation::Operation;

fn process_operation(op: Operation) {
    if op.is_insertion() {
        println!("Performing insertion operation");
    } else if op.is_deletion() {
        println!("Performing deletion operation");
    }
}

fn main() {
    let insert_op = Operation::Insertion;
    let delete_op = Operation::Deletion;

    process_operation(insert_op);
    process_operation(delete_op);
}

Safety and Performance

This crate benefits from Rust's ownership system, guaranteeing memory safety and preventing data races. Optimized for performance, icentral-operation leverages Rust's zero-cost abstractions to minimize runtime overhead.

Contributing

Contributions are welcome! Please ensure your code adheres to the Rust community coding standards.


This README was generated by an AI model. It strives to be accurate and helpful, but may not capture every nuance of the crate's capabilities.

This crate is in the process of being translated from c++ to rust. Currently, it still needs exhaustive testing. It is likely there currently exist many glitches which need to be fixed before proper usage. This crate is based on the original icentral program developed by Fuad Jamor. Please see the following repository for details: https://github.com/fjamour/icentral.

For progress updates, see the workspacer rust project.

Dependencies

~15–25MB
~378K SLoC