TBV-Rust-SDK 0.1.2

Rust SDK for the TBV application and CLI
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::ffi::log_message;

pub fn log(message: &str) {
    let bytes = message.as_bytes();
    unsafe {
        log_message(bytes.as_ptr(), bytes.len() as i32);
    }
}

pub fn read_html_code(html_code: &str) -> Result<String, String> {
    if html_code.is_empty() {
        Err("Error: empty HTML code provided".to_string())
    } else {
        Ok(html_code.to_string())
    }
}