summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@atos.net>2019-04-25 09:32:37 +0200
committerMatthias Beyer <matthias.beyer@atos.net>2019-04-25 09:32:37 +0200
commit9f8682bee94ee349aa5086bdab257f7ce5cfcdb1 (patch)
tree8060a9d0ecda3478df5c80766dbb9e12d5b3ffa7
parent288cd8b16b619dc7824467bbe3a09e9502b3bf5a (diff)
Add doc: v1::api::Api
-rw-r--r--librepology/src/v1/api.rs8
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>>;