mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-28 16:25:10 +00:00
34 lines
849 B
Rust
34 lines
849 B
Rust
// Code generated by ndpgen. 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>,
|
|
}
|
|
|
|
#[link(wasm_import_module = "extism:host/user")]
|
|
extern "C" {
|
|
fn ping_ping(input: u64) -> u64;
|
|
}
|
|
|
|
/// Calls the ping_ping host function.
|
|
///
|
|
/// # Errors
|
|
/// Returns an error if the host function call fails.
|
|
pub fn ping() -> Result<(), Error> {
|
|
let response: PingPingResponse = unsafe { nd_pdk_types::hostcall::call(ping_ping, &serde_json::json!({})) }?;
|
|
|
|
if let Some(err) = response.error {
|
|
return Err(Error::msg(err));
|
|
}
|
|
|
|
Ok(())
|
|
}
|