mirror of
https://github.com/navidrome/navidrome.git
synced 2026-03-04 06:35:52 +00:00
36 lines
831 B
Rust
36 lines
831 B
Rust
// Code generated by hostgen. DO NOT EDIT.
|
|
//
|
|
// This file contains client wrappers for the Ping host service.
|
|
// It is intended for use in Navidrome plugins built with extism-pdk.
|
|
|
|
use extism_pdk::*;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Debug, Clone, Deserialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
struct PingPingResponse {
|
|
#[serde(default)]
|
|
error: Option<String>,
|
|
}
|
|
|
|
#[host_fn]
|
|
extern "ExtismHost" {
|
|
fn ping_ping(input: Json<serde_json::Value>) -> Json<PingPingResponse>;
|
|
}
|
|
|
|
/// Calls the ping_ping host function.
|
|
///
|
|
/// # Errors
|
|
/// Returns an error if the host function call fails.
|
|
pub fn ping() -> Result<(), Error> {
|
|
let response = unsafe {
|
|
ping_ping(Json(serde_json::json!({})))?
|
|
};
|
|
|
|
if let Some(err) = response.0.error {
|
|
return Err(Error::msg(err));
|
|
}
|
|
|
|
Ok(())
|
|
}
|