Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Feature Flags

rok-utils uses feature flags to control which dependencies are included.

Default Features

By default, rok-utils has no optional dependencies enabled.

[dependencies]
rok-utils = "0.2"

This includes:

  • String utilities (case conversion, truncate, slug, etc.)
  • Fluent builder (Str::of())
  • Array utilities (map, filter, reduce, etc.)
  • Error handling (RokError)
  • Functional patterns (pipe, compose, tap)
  • Path utilities

Optional Features

dates

Enables date/time utilities using chrono.

rok-utils = { version = "0.2", features = ["dates"] }

Added functions:

  • now(), today(), yesterday(), tomorrow()
  • add_days(), add_hours()
  • format_date(), parse_date()
  • diff_days()

crypto

Enables hashing and token generation.

rok-utils = { version = "0.2", features = ["crypto"] }

Added functions:

  • hash_sha256(), verify_sha256()
  • generate_token()
  • secure_compare()

ids

Enables UUID and ULID generation.

rok-utils = { version = "0.2", features = ["ids"] }

Added functions:

  • uuid_v4(), uuid_v7(), ulid()
  • is_uuid(), is_ulid()

json

Enables JSON type guards and path utilities.

rok-utils = { version = "0.2", features = ["json"] }

Added functions:

  • is_string(), is_number(), is_bool(), etc.
  • get_path(), set_path()
  • deep_equal()

random

Enables random string generation.

rok-utils = { version = "0.2", features = ["random"] }

Added functions:

  • random()
  • password()
  • shuffle()

unicode

Enables Unicode-aware string operations.

rok-utils = { version = "0.2", features = ["unicode"] }

Added functions:

  • pluralize(), singular()
  • is_plural(), is_singular()

All Features

Enable all optional features:

rok-utils = { version = "0.2", features = ["full"] }

Or explicitly:

rok-utils = { version = "0.2", features = ["dates", "crypto", "ids", "json", "random", "unicode"] }