pub trait Marshallable {
type Error: Error + Send + Sync + 'static;
// Required methods
fn from_bytes(content: &[u8]) -> Result<Self, Self::Error>
where Self: Sized;
fn empty() -> Self;
fn to_bytes(&self) -> Option<Vec<u8>>;
fn snapshot(&self) -> Self;
fn has_changed(&self, other: &Self) -> bool;
}Expand description
A trait for types that can be edited
Required Associated Types§
Required Methods§
Sourcefn from_bytes(content: &[u8]) -> Result<Self, Self::Error>where
Self: Sized,
fn from_bytes(content: &[u8]) -> Result<Self, Self::Error>where
Self: Sized,
Parse the contents of a file
Sourcefn has_changed(&self, other: &Self) -> bool
fn has_changed(&self, other: &Self) -> bool
Check if the current state has changed compared to another state
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.