waddling-sequences 0.1.0

Standard error sequence constants for consistent diagnostic codes across the Waddling ecosystem
Documentation
# 🦆 waddling-sequences

**Standard error sequence definitions for the Waddling ecosystem**

[![Crates.io](https://img.shields.io/crates/v/waddling-sequences.svg)](https://crates.io/crates/waddling-sequences)
[![Docs.rs](https://docs.rs/waddling-sequences/badge.svg)](https://docs.rs/waddling-sequences)
[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](LICENSE-MIT)

---

## What is this?

`waddling-sequences` provides **standardized error sequence numbers** with semantic meanings that are consistent across the entire Waddling ecosystem.

Think of it like **HTTP status codes** for errors:
- Everyone knows `404 = Not Found`
- With Waddling: Everyone knows `001 = Missing`, `002 = Mismatch`, etc.

## Features

- **Zero dependencies** - Just pure constants
-**No-std compatible** - Works everywhere
-**Tree-shakeable** - Only imports what you use
-**Universal** - Works with any error library
-**Well-documented** - Every sequence has clear meaning

## Quick Start

```rust
use waddling_sequences::core::*;

// Use standard sequences with semantic meaning
const MY_ERROR_CODE: u16 = MISSING;  // 001 - always means "missing"
const OTHER_ERROR: u16 = MISMATCH;   // 002 - always means "mismatch"

// Everyone in the ecosystem knows what these mean!
```

## Sequence Categories

### Core Errors (001-010)
```rust
use waddling_sequences::core::*;

MISSING       // 001 - Required item not found/provided
MISMATCH      // 002 - Values don't match expected
INVALID       // 003 - Format/validation failed
OVERFLOW      // 004 - Value too large
UNDERFLOW     // 005 - Value too small
OUTOFBOUNDS   // 006 - Index outside valid range
TIMEOUT       // 007 - Operation timed out
DENIED        // 008 - Permission denied
UNSUPPORTED   // 009 - Feature not supported
DEPRECATED    // 010 - Feature deprecated
```

### State/Lifecycle (011-020)
```rust
use waddling_sequences::state::*;

UNINITIALIZED // 011 - Not initialized
ALREADYINIT   // 012 - Already initialized
CLOSED        // 013 - Resource closed
NOTREADY      // 014 - Not ready for operation
INPROGRESS    // 015 - Operation in progress
CANCELLED     // 016 - Operation cancelled
```

### Resource Errors (021-030)
```rust
use waddling_sequences::resource::*;

NOTFOUND      // 021 - Resource not found
ALREADYEXISTS // 022 - Resource already exists
EXHAUSTED     // 023 - Resource exhausted
LOCKED        // 024 - Resource locked
CORRUPTED     // 025 - Data corrupted
```

### Success (998-999)
```rust
use waddling_sequences::success::*;

PARTIAL       // 998 - Partial success
COMPLETE      // 999 - Full completion
```

## With Metadata Feature

Enable the `metadata` feature to get documentation strings:

```toml
[dependencies]
waddling-sequences = { version = "0.1", features = ["metadata"] }
```

```rust
use waddling_sequences::metadata::DOCS;

// Get documentation for a sequence
let doc = DOCS.get(&001).unwrap();
println!("{}", doc); // "Required item not found/provided"
```

## Project-Specific Sequences

Sequences 031-897 are **unreserved** - use them for domain-specific errors!

```rust
// Your custom sequences
const MY_CUSTOM_ERROR: u16 = 031;
const ANOTHER_ERROR: u16 = 050;
```

## Usage with waddling-errors

```rust
use waddling_errors::ErrorCode;
use waddling_sequences::core::MISMATCH;

const TYPE_ERROR: ErrorCode = 
    ErrorCode::new("TYPES", "CHECK", MISMATCH);
```

## Why Standard Sequences?

### Before (Inconsistent)
```rust
// Project A
const ERR_MISSING: u16 = 001;  // "missing"
const ERR_NOTFOUND: u16 = 002; // "not found"

// Project B  
const ERR_NOTFOUND: u16 = 001; // "not found"
const ERR_MISSING: u16 = 005;  // "missing"
```
❌ Same concept, different numbers across projects!

### After (Consistent)
```rust
// Project A
use waddling_sequences::core::MISSING;  // 001

// Project B
use waddling_sequences::core::MISSING;  // 001
```
✅ Same number, same meaning, everywhere!

## Convention Document

See [SEQUENCE-CONVENTIONS.md](./SEQUENCE-CONVENTIONS.md) for full details on the standardized sequences.

## No-std Support

Works in no-std environments:
```rust
#![no_std]
use waddling_sequences::core::*;
```

## License

Licensed under either of:

- Apache License, Version 2.0 ([LICENSE-APACHE]LICENSE-APACHE)
- MIT license ([LICENSE-MIT]LICENSE-MIT)

at your option.

## Contributing

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md).

---

**Made with 🦆 by the Waddling team**