refactor: changed structure.

This commit is contained in:
Strix 2023-10-14 22:39:46 +02:00
parent 6098dce4aa
commit 4e64d3a73c
No known key found for this signature in database
GPG key ID: 49B2E37B8915B774
8 changed files with 113 additions and 89 deletions

10
pkgr/src/types/fetch.rs Normal file
View file

@ -0,0 +1,10 @@
/// Get a result from an external source
pub trait Fetch<Q, R = Self> {
fn fetch(query: Q) -> R;
}
/// Try to get a result from an external source
pub trait TryFetch<Q, R = Self> {
type Error;
fn try_fetch(query: Q) -> Result<R, Self::Error>;
}

1
pkgr/src/types/mod.rs Normal file
View file

@ -0,0 +1 @@
pub mod fetch;