WIP on get channel info for arch app
This commit is contained in:
18
archapp_xc/src/lib.rs
Normal file
18
archapp_xc/src/lib.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
use err::Error;
|
||||
use serde::Serialize;
|
||||
|
||||
pub type RT1 = Box<dyn ItemSer + Send>;
|
||||
|
||||
pub trait ItemSer {
|
||||
fn serialize(&self) -> Result<Vec<u8>, Error>;
|
||||
}
|
||||
|
||||
impl<T> ItemSer for T
|
||||
where
|
||||
T: Serialize,
|
||||
{
|
||||
fn serialize(&self) -> Result<Vec<u8>, Error> {
|
||||
let u = serde_json::to_vec(self)?;
|
||||
Ok(u)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user