pub trait LazyIssue<S: Clone + Debug>: Sized {
type Error: Error;
// Required methods
async fn parent_index(source: &S) -> Result<Option<IssueIndex>, Self::Error>;
async fn identity(
&mut self,
source: S,
) -> Result<IssueIdentity, Self::Error>;
async fn contents(
&mut self,
source: S,
) -> Result<IssueContents, Self::Error>;
async fn children(&mut self, source: S) -> Result<Vec<Issue>, Self::Error>;
// Provided method
async fn load(source: S) -> Result<Issue, Self::Error>
where Issue: LazyIssue<S, Error = Self::Error> { ... }
}Expand description
Trait for lazily loading an issue from a source.
S is the source type directly (e.g., LocalIssueSource<FsReader>, RemoteSource).
Methods load data on demand; &mut self allows caching intermediate results.
Required Associated Types§
Required Methods§
Sourceasync fn parent_index(source: &S) -> Result<Option<IssueIndex>, Self::Error>
async fn parent_index(source: &S) -> Result<Option<IssueIndex>, Self::Error>
Resolve parent_index from the source. Returns None for root-level issues (no parent).
async fn identity(&mut self, source: S) -> Result<IssueIdentity, Self::Error>
async fn contents(&mut self, source: S) -> Result<IssueContents, Self::Error>
async fn children(&mut self, source: S) -> Result<Vec<Issue>, Self::Error>
Provided Methods§
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.