Trait llm_chain::serialization::StorableEntity
source · 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>
Implementors§
impl<E> StorableEntity for llm_chain::chains::map_reduce::Chain<E>where E: Executor,
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