pub trait FileFormater {
// Required methods
fn from_file<T: WebOfTrust>(
&self,
path: &str,
max_links: usize,
) -> Result<(T, Vec<u8>), WotParseError>;
fn to_file<T: WebOfTrust>(
&self,
wot: &T,
data: &[u8],
path: &str,
) -> Result<(), WotWriteError>;
}Expand description
Provide Read/Write functions for WebOfTrust objects.
Required Methods§
Sourcefn from_file<T: WebOfTrust>(
&self,
path: &str,
max_links: usize,
) -> Result<(T, Vec<u8>), WotParseError>
fn from_file<T: WebOfTrust>( &self, path: &str, max_links: usize, ) -> Result<(T, Vec<u8>), WotParseError>
Try to read a WebOfTrust from a file.
Sourcefn to_file<T: WebOfTrust>(
&self,
wot: &T,
data: &[u8],
path: &str,
) -> Result<(), WotWriteError>
fn to_file<T: WebOfTrust>( &self, wot: &T, data: &[u8], path: &str, ) -> Result<(), WotWriteError>
Tru to write a WebOfTrust in a file.
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.