Skip to content

Bellande Importer is an Importer file that makes it easier to import functions and classes and make other files like an extensions of another file

License

Notifications You must be signed in to change notification settings

Architecture-Mechanism/bellande_importer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bellande Importer

  • Bellande Importer is an Importer file that makes it easier to import functions and classes and make other files like an extensions of another file

use bellande_rust_import::{Importer, import, from_import};
use std::path::PathBuf;

fn main() {
    // Create a new Importer instance
    let mut importer = Importer::new();

    // Add a search path for modules
    importer.add_search_path(PathBuf::from("src/modules"));

    // Import a module
    let module = import!(importer, "math");

    // Import specific symbols from a module
    from_import!(importer, "math", add, subtract);

    // Use the imported symbols
    println!("2 + 3 = {}", add(2, 3));
    println!("5 - 2 = {}", subtract(5, 2));

    // Access the full module structure
    println!("Module path: {:?}", module.path);
    println!("Number of items: {}", module.ast.items.len());
}

Website Crates

Installation

  • cargo add bellande_rust_import
Name: bellande_rust_import
Version: 0.0.1
Summary: Bellande Importer of Rust Module
sHome-page: github.com/Architecture-Mechanism/bellande_rust_import
Author: Ronaldson Bellande
Author-email: ronaldsonbellande@gmail.com
License: GNU General Public License v3.0

License

Bellande Rust Importer is distributed under the GNU General Public License v3.0, see LICENSE and NOTICE for more information.

About

Bellande Importer is an Importer file that makes it easier to import functions and classes and make other files like an extensions of another file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages