refactor: changed structure.
This commit is contained in:
parent
6098dce4aa
commit
4e64d3a73c
8 changed files with 113 additions and 89 deletions
10
pkgr/src/types/fetch.rs
Normal file
10
pkgr/src/types/fetch.rs
Normal 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
1
pkgr/src/types/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
pub mod fetch;
|
Loading…
Add table
Add a link
Reference in a new issue