summaryrefslogtreecommitdiff
path: root/rust/src/repository/plugin.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src/repository/plugin.rs')
-rw-r--r--rust/src/repository/plugin.rs60
1 files changed, 30 insertions, 30 deletions
diff --git a/rust/src/repository/plugin.rs b/rust/src/repository/plugin.rs
index af3886f2..82309e79 100644
--- a/rust/src/repository/plugin.rs
+++ b/rust/src/repository/plugin.rs
@@ -31,31 +31,31 @@ impl RepositoryPlugin {
}
/// String of the plugin author
- pub fn author(&self) -> BnString {
+ pub fn author(&self) -> String {
let result = unsafe { BNPluginGetAuthor(self.handle.as_ptr()) };
assert!(!result.is_null());
- unsafe { BnString::from_raw(result as *mut c_char) }
+ unsafe { BnString::into_string(result as *mut c_char) }
}
/// String short description of the plugin
- pub fn description(&self) -> BnString {
+ pub fn description(&self) -> String {
let result = unsafe { BNPluginGetDescription(self.handle.as_ptr()) };
assert!(!result.is_null());
- unsafe { BnString::from_raw(result as *mut c_char) }
+ unsafe { BnString::into_string(result as *mut c_char) }
}
/// String complete license text for the given plugin
- pub fn license_text(&self) -> BnString {
+ pub fn license_text(&self) -> String {
let result = unsafe { BNPluginGetLicenseText(self.handle.as_ptr()) };
assert!(!result.is_null());
- unsafe { BnString::from_raw(result as *mut c_char) }
+ unsafe { BnString::into_string(result as *mut c_char) }
}
/// String long description of the plugin
- pub fn long_description(&self) -> BnString {
+ pub fn long_description(&self) -> String {
let result = unsafe { BNPluginGetLongdescription(self.handle.as_ptr()) };
assert!(!result.is_null());
- unsafe { BnString::from_raw(result as *mut c_char) }
+ unsafe { BnString::into_string(result as *mut c_char) }
}
/// Minimum version info the plugin was tested on
@@ -71,65 +71,65 @@ impl RepositoryPlugin {
}
/// String plugin name
- pub fn name(&self) -> BnString {
+ pub fn name(&self) -> String {
let result = unsafe { BNPluginGetName(self.handle.as_ptr()) };
assert!(!result.is_null());
- unsafe { BnString::from_raw(result as *mut c_char) }
+ unsafe { BnString::into_string(result as *mut c_char) }
}
/// String URL of the plugin's git repository
- pub fn project_url(&self) -> BnString {
+ pub fn project_url(&self) -> String {
let result = unsafe { BNPluginGetProjectUrl(self.handle.as_ptr()) };
assert!(!result.is_null());
- unsafe { BnString::from_raw(result as *mut c_char) }
+ unsafe { BnString::into_string(result as *mut c_char) }
}
/// String URL of the plugin's git repository
- pub fn package_url(&self) -> BnString {
+ pub fn package_url(&self) -> String {
let result = unsafe { BNPluginGetPackageUrl(self.handle.as_ptr()) };
assert!(!result.is_null());
- unsafe { BnString::from_raw(result as *mut c_char) }
+ unsafe { BnString::into_string(result as *mut c_char) }
}
/// String URL of the plugin author's url
- pub fn author_url(&self) -> BnString {
+ pub fn author_url(&self) -> String {
let result = unsafe { BNPluginGetAuthorUrl(self.handle.as_ptr()) };
assert!(!result.is_null());
- unsafe { BnString::from_raw(result as *mut c_char) }
+ unsafe { BnString::into_string(result as *mut c_char) }
}
/// String version of the plugin
- pub fn version(&self) -> BnString {
+ pub fn version(&self) -> String {
let result = unsafe { BNPluginGetVersion(self.handle.as_ptr()) };
assert!(!result.is_null());
- unsafe { BnString::from_raw(result as *mut c_char) }
+ unsafe { BnString::into_string(result as *mut c_char) }
}
/// String of the commit of this plugin git repository
- pub fn commit(&self) -> BnString {
+ pub fn commit(&self) -> String {
let result = unsafe { BNPluginGetCommit(self.handle.as_ptr()) };
assert!(!result.is_null());
- unsafe { BnString::from_raw(result as *mut c_char) }
+ unsafe { BnString::into_string(result as *mut c_char) }
}
/// Relative path from the base of the repository to the actual plugin
- pub fn path(&self) -> BnString {
+ pub fn path(&self) -> String {
let result = unsafe { BNPluginGetPath(self.handle.as_ptr()) };
assert!(!result.is_null());
- unsafe { BnString::from_raw(result as *mut c_char) }
+ unsafe { BnString::into_string(result as *mut c_char) }
}
/// Optional sub-directory the plugin code lives in as a relative path from the plugin root
- pub fn subdir(&self) -> BnString {
+ pub fn subdir(&self) -> String {
let result = unsafe { BNPluginGetSubdir(self.handle.as_ptr()) };
assert!(!result.is_null());
- unsafe { BnString::from_raw(result as *mut c_char) }
+ unsafe { BnString::into_string(result as *mut c_char) }
}
/// Dependencies required for installing this plugin
- pub fn dependencies(&self) -> BnString {
+ pub fn dependencies(&self) -> String {
let result = unsafe { BNPluginGetDependencies(self.handle.as_ptr()) };
assert!(!result.is_null());
- unsafe { BnString::from_raw(result as *mut c_char) }
+ unsafe { BnString::into_string(result as *mut c_char) }
}
/// true if the plugin is installed, false otherwise
@@ -190,10 +190,10 @@ impl RepositoryPlugin {
unsafe { Array::new(result, count, ()) }
}
- pub fn repository(&self) -> BnString {
+ pub fn repository(&self) -> String {
let result = unsafe { BNPluginGetRepository(self.handle.as_ptr()) };
assert!(!result.is_null());
- unsafe { BnString::from_raw(result as *mut c_char) }
+ unsafe { BnString::into_string(result as *mut c_char) }
}
/// Boolean status indicating that the plugin is being deleted
@@ -237,10 +237,10 @@ impl RepositoryPlugin {
}
/// Gets a json object of the project data field
- pub fn project_data(&self) -> BnString {
+ pub fn project_data(&self) -> String {
let result = unsafe { BNPluginGetProjectData(self.handle.as_ptr()) };
assert!(!result.is_null());
- unsafe { BnString::from_raw(result) }
+ unsafe { BnString::into_string(result) }
}
/// Returns a datetime object representing the plugins last update