openai_client_cli/program/traits/loader.rs
1use crate::{Entry, Result};
2
3/// A trait to load an object from the program entry.
4pub trait Loader<T>
5where
6 Self: Sized
7{
8 /// Fetch an object from the program entry.
9 fn fetch(entry: &Entry) -> Result<Self>;
10 /// Move the sealed object out.
11 fn value(self) -> T;
12 /// Returns the refernece of the sealed object.
13 fn value_ref(&self) -> &T;
14}