@@ -7,6 +7,13 @@ use serde::{Deserialize, Serialize};
77
88/// Kind of a file.
99#[ derive( Debug , Clone , Copy , PartialEq , Eq , PartialOrd , Ord ) ]
10+ #[ cfg_attr(
11+ feature = "rkyv" ,
12+ derive( rkyv:: Archive , rkyv:: Serialize , rkyv:: Deserialize )
13+ ) ]
14+ #[ cfg_attr( feature = "rkyv_validation" , derive( bytecheck:: CheckBytes ) ) ]
15+ #[ cfg_attr( feature = "serde_derive" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
16+ #[ repr( u8 ) ]
1017pub enum FileKind {
1118 /// An attachment file.
1219 Attachment ,
@@ -16,6 +23,12 @@ pub enum FileKind {
1623
1724/// A "file id", which can be a HMC URL, an external URL or a plain ID string.
1825#[ derive( Debug , Clone , Display , PartialEq , Eq , Hash ) ]
26+ /* blocked on Hmc
27+ #[cfg_attr(feature = "rkyv", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize))]
28+ #[cfg_attr(feature = "rkyv_validation", derive(bytecheck::CheckBytes))]
29+ #[cfg_attr(feature = "serde_derive", derive(serde::Serialize, serde::Deserialize))]
30+ #[repr(u8)]
31+ */
1932pub enum FileId {
2033 /// A HMC describing where the file is.
2134 Hmc ( Hmc ) ,
@@ -158,6 +171,11 @@ pub fn extract_file_info_from_download_response<'a>(
158171/// Struct that implements `serde` `Deserialize` / `Serialize` and can be used for
159172/// the [`/_harmony/about`](https://github.com/harmony-development/protocol/blob/main/stable/rest/rest.md#get-_harmonyabout) endpoint.
160173#[ derive( Debug , Clone , Hash , PartialEq , Eq , Deserialize , Serialize ) ]
174+ #[ cfg_attr(
175+ feature = "rkyv" ,
176+ derive( rkyv:: Archive , rkyv:: Serialize , rkyv:: Deserialize )
177+ ) ]
178+ #[ cfg_attr( feature = "rkyv_validation" , derive( bytecheck:: CheckBytes ) ) ]
161179pub struct About {
162180 /// the Harmony server software being hosted.
163181 #[ serde( rename = "serverName" ) ]
0 commit comments