xnode-manager-sdk 1.0.4

Rust Software Development Kit for interacting with Xnode Manager
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
pub enum Output {
    Bytes { output: Vec<u8> },
    UTF8 { output: String },
}

impl From<Vec<u8>> for Output {
    fn from(value: Vec<u8>) -> Self {
        match String::from_utf8(value.clone()) {
            Ok(output) => Output::UTF8 { output },
            Err(_) => Output::Bytes { output: value },
        }
    }
}