diff options
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/src/repository/plugin.rs | 7 | ||||
| -rw-r--r-- | rust/tests/repository.rs | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/rust/src/repository/plugin.rs b/rust/src/repository/plugin.rs index ac7c9d20..1abee1e8 100644 --- a/rust/src/repository/plugin.rs +++ b/rust/src/repository/plugin.rs @@ -103,6 +103,13 @@ impl Extension { unsafe { BnString::into_string(result as *mut c_char) } } + /// String complete license text for the given plugin + pub fn license_text(&self) -> String { + let result = unsafe { BNPluginGetLicenseText(self.handle.as_ptr()) }; + assert!(!result.is_null()); + unsafe { BnString::into_string(result as *mut c_char) } + } + /// Minimum version info the plugin was tested on pub fn minimum_version_info(&self) -> VersionInfo { let result = unsafe { BNPluginGetMinimumVersionInfo(self.handle.as_ptr()) }; diff --git a/rust/tests/repository.rs b/rust/tests/repository.rs index ac861b2c..d22f900d 100644 --- a/rust/tests/repository.rs +++ b/rust/tests/repository.rs @@ -20,6 +20,7 @@ fn test_list() { for plugin in &plugins { let plugin_path = plugin.path(); let plugin_by_path = repository.plugin_by_path(&plugin_path).unwrap(); + let _license_text = plugin.license_text(); assert_eq!(plugin.package_url(), plugin_by_path.package_url()); } } |
