Skip to main content

LazyIssue

Trait LazyIssue 

Source
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§

Source

type Error: Error

Error type for operations on this source.

Required Methods§

Source

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).

Source

async fn identity(&mut self, source: S) -> Result<IssueIdentity, Self::Error>

Source

async fn contents(&mut self, source: S) -> Result<IssueContents, Self::Error>

Source

async fn children(&mut self, source: S) -> Result<Vec<Issue>, Self::Error>

Provided Methods§

Source

async fn load(source: S) -> Result<Issue, Self::Error>
where Issue: LazyIssue<S, Error = Self::Error>,

Load a full issue tree from the source. Default implementation calls parent_index, then populates identity, contents, and children.

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§