Skip to content

Commit

Permalink
feat: Add requires_backend check to capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
DashieTM committed Apr 9, 2024
1 parent 8c1be9a commit 707cdde
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/utils/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,22 @@ pub enum PluginImplementation {
}

#[repr(C)]
pub struct PluginCapabilities(Vec<&'static str>, PluginImplementation);
pub struct PluginCapabilities(Vec<&'static str>, bool, PluginImplementation);

impl PluginCapabilities {
pub fn get_capabilities(&self) -> Vec<&'static str> {
self.0.clone()
pub fn get_capabilities(&self) -> (Vec<&'static str>, bool) {
(self.0.clone(), self.1)
}
pub fn get_implementation(&self) -> &PluginImplementation {
&self.1
&self.2
}

pub fn new(capabilities: Vec<&'static str>, implementation: PluginImplementation) -> Self {
Self(capabilities, implementation)
pub fn new(
capabilities: Vec<&'static str>,
requires_backend: bool,
implementation: PluginImplementation,
) -> Self {
Self(capabilities, requires_backend, implementation)
}
}

Expand Down

0 comments on commit 707cdde

Please sign in to comment.