kmmp-project-manager 0.1.0

kmmp-project-manager is a Rust crate for Kotlin Multiplatform (KMP) projects, offering a lightweight alternative to Android Studio. It provides tools for project creation, structure management, build automation, code generation, IDE integration, dependency management, and project configuration.
Documentation
use crate::{Dependencies, SourceSets};

use serde::{Serialize,Deserialize};

/// Represents the content of a module, which can be either source sets or dependencies.
/// 
#[derive(Deserialize, Serialize, Debug, PartialEq)]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum ModuleContent<'a> {
    /// Source sets configuration aka multiplatform module.
    SourceSets(SourceSets<'a>),
    /// Dependencies configuration aka andorid only module.
    Dependencies(Dependencies<'a>),
}

impl std::fmt::Display for ModuleContent<'_> {
    /// Formats the `ModuleContent` as a string.
    ///
    /// # Example
    ///
    /// ```
    /// let source_sets = SourceSets::new(/* source sets details */);
    /// let dependencies = Dependencies::new(/* dependencies details */);
    ///
    /// let module_content = ModuleContent::SourceSets(source_sets);
    /// assert_eq!(module_content.to_string(), "/* formatted source sets */");
    ///
    /// let module_content = ModuleContent::Dependencies(dependencies);
    /// assert_eq!(module_content.to_string(), "/* formatted dependencies */");
    /// ```
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            ModuleContent::SourceSets(source_sets) => write!(f, "{}", source_sets.to_string())?,
            ModuleContent::Dependencies(dependencies) => write!(f, "{}", dependencies.to_string())?,
        };
        Ok(())
    }
}