Something went wrong. Try again.
Monorepo for Tangled forked from tangled.org/core
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839use std::future::Future;use std::pin::Pin;
use gix_hash::ObjectId;use jacquard_common::deps::smol_str::SmolStr;use jacquard_common::types::did::Did;
pub type SourceFuture<'a, T> = Pin<Box<dyn Future<Output = T> + Send + 'a>>;
pub trait LanguageSource: Send + Sync { fn page<'a>( &'a self, cursor: Option<&'a str>, limit: usize, ) -> SourceFuture<'a, Result<Page, String>>;
fn languages<'a>(&'a self, repo: &'a Did, commit: ObjectId) -> SourceFuture<'a, Fetched>;}
#[derive(Debug, Default)]pub struct Page { pub repos: Vec<IndexedRepo>, pub cursor: Option<SmolStr>,}
#[derive(Debug)]pub struct IndexedRepo { pub repo: Did, pub commit: ObjectId, pub languages: Vec<(SmolStr, i64)>,}
#[derive(Debug)]pub enum Fetched { Languages(Vec<(SmolStr, i64)>), NotReady(SmolStr), Failed(String),}