doc: clean code for documentation output

This commit is contained in:
2025-10-09 15:41:39 +02:00
parent 63ecb15824
commit 718176edbd
9 changed files with 16 additions and 17 deletions

View File

@@ -10,13 +10,13 @@ mod tst;
pub(crate) use crate::str::attribute::O as Attribute; pub(crate) use crate::str::attribute::O as Attribute;
pub use crate::str::catalog::O as Catalog; pub use crate::str::catalog::O as Catalog;
pub use crate::str::entity::O as Entity; pub use crate::str::entity::O as Entity;
pub use crate::str::entity_state::E as EntityState; pub use crate::str::entity_state::EntityState;
pub use crate::str::failed_to::E as FailedTo; pub use crate::str::failed_to::FailedTo;
pub(crate) use crate::str::value::E as Value; pub(crate) use crate::str::value::Value;
pub use crate::trt::eav::T as EAV; pub use crate::trt::eav::T as EAV;
mod sqlite { mod sqlite {
pub use crate::str::sqlite_failed_to::E as FailedTo; pub use crate::str::sqlite_failed_to::FailedTo;
pub mod init { pub mod init {
pub use crate::fun::sqlite_init_db::run as db; pub use crate::fun::sqlite_init_db::run as db;
} }

View File

@@ -6,7 +6,7 @@ pub struct O {
pub value: Value, pub value: Value,
} }
impl O { impl Attribute {
pub fn new(id: &str, value: impl Into<Value>) -> Self { pub fn new(id: &str, value: impl Into<Value>) -> Self {
Self { Self {
id: String::from(id), id: String::from(id),

View File

@@ -9,7 +9,7 @@ pub struct O {
path: String, path: String,
pub(crate) items: std::collections::HashMap<String, Entity>, pub(crate) items: std::collections::HashMap<String, Entity>,
} }
impl O { impl Catalog {
/// Creates a new `Catalog` instance. /// Creates a new `Catalog` instance.
/// ///
/// # Arguments /// # Arguments

View File

@@ -10,7 +10,7 @@ pub struct O {
pub attributes: std::collections::HashMap<String, Attribute>, pub attributes: std::collections::HashMap<String, Attribute>,
} }
impl O { impl Entity {
/// Creates a new `Entity` instance for a given type `T` that implements `EAV`. /// Creates a new `Entity` instance for a given type `T` that implements `EAV`.
/// ///
/// # Returns /// # Returns

View File

@@ -1,6 +1,6 @@
/// Represents the state of an entity within the catalog. /// Represents the state of an entity within the catalog.
#[derive(Debug, Default, PartialEq, PartialOrd, Eq, Ord, Clone, Copy, Hash)] #[derive(Debug, Default, PartialEq, PartialOrd, Eq, Ord, Clone, Copy, Hash)]
pub enum E { pub enum EntityState {
/// The entity is newly created and has not been persisted. /// The entity is newly created and has not been persisted.
#[default] #[default]
New, New,

View File

@@ -2,7 +2,7 @@ use crate::*;
/// Represents the possible failures that can occur in the library. /// Represents the possible failures that can occur in the library.
#[derive(Debug, PartialEq, PartialOrd, Eq, Ord, Clone, Copy, Hash)] #[derive(Debug, PartialEq, PartialOrd, Eq, Ord, Clone, Copy, Hash)]
pub enum E { pub enum FailedTo {
/// Failed to initialize the database. /// Failed to initialize the database.
InitDatabase, InitDatabase,
/// Failed to load data from the database. /// Failed to load data from the database.
@@ -17,7 +17,7 @@ pub enum E {
SQLite(sqlite::FailedTo), SQLite(sqlite::FailedTo),
} }
impl From<sqlite::FailedTo> for E { impl From<sqlite::FailedTo> for FailedTo {
fn from(value: sqlite::FailedTo) -> Self { fn from(value: sqlite::FailedTo) -> Self {
Self::SQLite(value) Self::SQLite(value)
} }

View File

@@ -1,5 +1,5 @@
#[derive(Debug, PartialEq, PartialOrd, Eq, Ord, Clone, Copy, Hash)] #[derive(Debug, PartialEq, PartialOrd, Eq, Ord, Clone, Copy, Hash)]
pub enum E { pub enum FailedTo {
BeginTransaction, BeginTransaction,
CommitTransaction, CommitTransaction,
ExecuteBatch, ExecuteBatch,

View File

@@ -1,7 +1,7 @@
use crate::*; use crate::*;
#[derive(Debug, PartialEq, PartialOrd, Clone)] #[derive(Debug, PartialEq, PartialOrd, Clone)]
pub enum E { pub enum Value {
Bool(bool), Bool(bool),
Real(f64), Real(f64),
SignedInt(i64), SignedInt(i64),
@@ -9,7 +9,7 @@ pub enum E {
UnsignedInt(u64), UnsignedInt(u64),
} }
impl std::fmt::Display for E { impl std::fmt::Display for Value {
fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
let string_value = match self { let string_value = match self {
Value::Bool(value) => match value { Value::Bool(value) => match value {

View File

@@ -4,8 +4,7 @@ use crate::*;
/// ///
/// This trait provides the necessary conversions to and from the generic `Entity` /// This trait provides the necessary conversions to and from the generic `Entity`
/// representation, and it requires the type to define its own class name. /// representation, and it requires the type to define its own class name.
pub trait T pub trait T where
where
Self: From<Entity>, Self: From<Entity>,
Self: Into<Entity>, Self: Into<Entity>,
{ {