batman
This commit is contained in:
8
common/Cargo.toml
Normal file
8
common/Cargo.toml
Normal file
@@ -0,0 +1,8 @@
|
||||
[package]
|
||||
name = "allpaca-models"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
prost = { workspace = true }
|
||||
json = { workspace = true }
|
25
common/src/lib.rs
Normal file
25
common/src/lib.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
use json::JsonValue;
|
||||
use prost::{
|
||||
alloc::{
|
||||
string::String,
|
||||
vec::Vec,
|
||||
}, *};
|
||||
|
||||
#[derive(Clone, PartialEq, Message)]
|
||||
pub struct Models(#[prost(message, repeated)] pub Vec<Model>);
|
||||
|
||||
#[derive(Clone, PartialEq, Message)]
|
||||
pub struct Model {
|
||||
#[prost(string)]
|
||||
pub modified_at: String,
|
||||
#[prost(string)]
|
||||
pub size: String,
|
||||
#[prost(string)]
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
impl Into<Vec<u8>> for Models {
|
||||
fn into(self) -> Vec<u8> {
|
||||
self.encode_to_vec()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user