rialo_cli_representation/
lib.rs

1// Copyright (c) Subzero Labs, Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4//! Rialo CLI Representation Traits
5//!
6//! This crate defines lightweight traits used by the CLI and proc-macro to enable
7//! human-readable and serializable representations for types printed in the CLI.
8//! It is intentionally a small, non-proc-macro crate so it can be depended on by
9//! both the main `rialo` crate and the `rialo-cli-representable` proc-macro crate.
10
11/// Trait for types that can format themselves for human-readable output
12pub trait HumanReadable {
13    /// Return a human-readable string representation
14    fn human_readable(&self) -> String;
15}
16
17/// Trait for types that can be represented in both human-readable and serialized formats
18pub trait Representable: HumanReadable + serde::Serialize {}