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 use crate::str::catalog::O as Catalog;
pub use crate::str::entity::O as Entity;
pub use crate::str::entity_state::E as EntityState;
pub use crate::str::failed_to::E as FailedTo;
pub(crate) use crate::str::value::E as Value;
pub use crate::str::entity_state::EntityState;
pub use crate::str::failed_to::FailedTo;
pub(crate) use crate::str::value::Value;
pub use crate::trt::eav::T as EAV;
mod sqlite {
pub use crate::str::sqlite_failed_to::E as FailedTo;
pub use crate::str::sqlite_failed_to::FailedTo;
pub mod init {
pub use crate::fun::sqlite_init_db::run as db;
}

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
/// Represents the state of an entity within the catalog.
#[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.
#[default]
New,
@@ -10,4 +10,4 @@ pub enum E {
Loaded,
/// The entity is marked for deletion.
ToDelete,
}
}

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
use crate::*;
#[derive(Debug, PartialEq, PartialOrd, Clone)]
pub enum E {
pub enum Value {
Bool(bool),
Real(f64),
SignedInt(i64),
@@ -9,7 +9,7 @@ pub enum E {
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> {
let string_value = match self {
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`
/// representation, and it requires the type to define its own class name.
pub trait T
where
pub trait T where
Self: From<Entity>,
Self: Into<Entity>,
{
@@ -13,4 +12,4 @@ where
///
/// This is used to distinguish between different types of entities in the database.
fn class() -> &'static str;
}
}