pub struct Envelope<T> {
pub metadata: HashMap<String, String>,
pub data: T,
}
Fields§
§metadata: HashMap<String, String>
§data: T
Implementations§
Source§impl<T> Envelope<T>where
T: Serialize + DeserializeOwned,
impl<T> Envelope<T>where
T: Serialize + DeserializeOwned,
pub fn read_file_sync(path: &str) -> Result<Self, EnvelopeError>
pub fn write_file_sync(&self, path: &str) -> Result<(), EnvelopeError>
Trait Implementations§
Source§impl<'de, T: Serialize + Deserialize<'de>> Deserialize<'de> for Envelope<T>
impl<'de, T: Serialize + Deserialize<'de>> Deserialize<'de> for Envelope<T>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<T> Freeze for Envelope<T>where
T: Freeze,
impl<T> RefUnwindSafe for Envelope<T>where
T: RefUnwindSafe,
impl<T> Send for Envelope<T>where
T: Send,
impl<T> Sync for Envelope<T>where
T: Sync,
impl<T> Unpin for Envelope<T>where
T: Unpin,
impl<T> UnwindSafe for Envelope<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more