diff options
Diffstat (limited to 'librepology/src/v1/api.rs')
-rw-r--r-- | librepology/src/v1/api.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/librepology/src/v1/api.rs b/librepology/src/v1/api.rs index d740d44..796b10e 100644 --- a/librepology/src/v1/api.rs +++ b/librepology/src/v1/api.rs @@ -9,6 +9,14 @@ use failure::Error; use crate::v1::types::Problem; use crate::v1::types::Package; +/// The high-level functionality of the repology API is represented in this trait +/// +/// Each "functionality" is represented via one function. +/// +/// # Note +/// +/// This is implemented as a _trait_ rather than a _struct_ because this way we can reuse the +/// functionality for operating on a stream, for example on stdin as a source of data. pub trait Api { fn project<N: AsRef<str>>(&self, name: N) -> Result<Vec<Package>>; |