question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Suggestion] Plugin system for the Rust rewrite

See original GitHub issue

Rust can export its libraries to .dll, .plugin and .so. So basically I would export a library and its main function would be called. You could import a library containing Graviton’s API.

use graviton;

fn main() {

}

https://gist.github.com/CoolOppo/67b452c125bb0db3212a9fbc44c84245

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
marc2332commented, Dec 26, 2021

Update: Graviton Desktop now loads extensions installed in <HOME_DIR>/.graviton/extensions

0reactions
marc2332commented, Dec 24, 2021

So far, the idea is this:

Extensions will have a single manifest file, (probably Cargo.toml). But, inside the extensions they can freely load more extensions which have it’s own information.

Example (from GitExtension):

impl Extension for GitExtension {
    fn get_info(&self) -> ExtensionInfo {
        ExtensionInfo {
            id: env!("CARGO_PKG_NAME").to_string(),
            name: env!("CARGO_PKG_NAME").to_string(),
        }
    } 
}

Every loaded extension will provide a get_info method which will return information about the Extension, in the case of the Git Extension I am just passing the values from the Cargo.toml, which are copied on compile time.

Because of this idea that Extensions can load multiple extensions, one extension could contain a group of extensions. To make it easier, it would be handy if all the extensions informations from the same group had something like a parent id, which pointed to the parent extension ID that would be defined in the manifest file. So, although they would be separate extensions, they would still be grouped via the parent ID.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plugins in Rust: The Technologies
In this first article I will analyze the different ways in which our plugin system may be implemented in Rust. Note that I'm...
Read more >
Awesome Rewrite It In Rust - A curated list of replacements ...
May I suggest a rename to "Alternatives in Rust (AIR)"? To add to this list: Starship - an alternative to your native shell...
Read more >
rust-unofficial/awesome-rust: A curated list of Rust code ...
A curated list of Rust code and resources. Contribute to rust-unofficial/awesome-rust development by creating an account on GitHub.
Read more >
Helix: A Neovim inspired editor, written in Rust
Lots of people are requesting a plugin extension system, ... When I want to rewrite a string in vim, I unconsciously type `ci"`; ......
Read more >
Something like module/plugin loading in rust - help
I would love to get some feedback on the ideas or alternative suggestions how to approach this ... My first steps trying to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found