pub trait StorableEntity: Serialize + DeserializeOwned {
// Required method
fn get_metadata() -> Vec<(String, String)>;
// Provided methods
fn to_envelope(self) -> Envelope<Self>
where Self: Sized { ... }
fn from_envelope(envelope: Envelope<Self>) -> Self { ... }
fn read_file_sync(path: &str) -> Result<Self, EnvelopeError> { ... }
fn write_file_sync(self, path: &str) -> Result<(), EnvelopeError> { ... }
}
Expand description
An entity that can be stored in an envelope.
Required Methods§
fn get_metadata() -> Vec<(String, String)>
Provided Methods§
fn to_envelope(self) -> Envelope<Self>where
Self: Sized,
fn from_envelope(envelope: Envelope<Self>) -> Self
fn read_file_sync(path: &str) -> Result<Self, EnvelopeError>
fn write_file_sync(self, path: &str) -> Result<(), EnvelopeError>
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.
Implementors§
impl StorableEntity for llm_chain::chains::map_reduce::Chain
Implements the StorableEntity
trait for the Chain
struct.
This implementation provides a method for extracting metadata from a Chain
instance, in order to identify it