Skip to content
This repository was archived by the owner on May 2, 2024. It is now read-only.

Commit 817e873

Browse files
committed
docs: improve style
1 parent 945b3ea commit 817e873

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/model/pacbuild.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub struct PacBuild {
2323

2424
/// Represents a `SemVer` version.
2525
/// # Examples
26+
///
2627
/// ```
2728
/// use libpacstall::model::Version;
2829
///
@@ -32,6 +33,7 @@ pub type Version = String;
3233

3334
/// Represents a `PacBuild` or Apt package name.
3435
/// # Examples
36+
///
3537
/// ```
3638
/// use libpacstall::model::PackageId;
3739
///
@@ -40,6 +42,7 @@ pub type Version = String;
4042
pub type PackageId = String;
4143
/// Represents an URL
4244
/// # Examples
45+
///
4346
/// ```
4447
/// use libpacstall::model::URL;
4548
///
@@ -48,6 +51,7 @@ pub type PackageId = String;
4851
pub type URL = String;
4952
/// Represents a file checksum
5053
/// # Examples
54+
///
5155
/// ```
5256
/// use libpacstall::model::Hash;
5357
///
@@ -57,6 +61,7 @@ pub type Hash = String;
5761

5862
/// Represents the install state of a package.
5963
/// # Examples
64+
///
6065
/// ```
6166
/// use chrono::NaiveDate;
6267
/// use libpacstall::model::InstallState;
@@ -87,6 +92,7 @@ impl InstallState {
8792
/// suffix.
8893
///
8994
/// # Examples
95+
///
9096
/// ```
9197
/// use libpacstall::model::Kind;
9298
///

src/store/base.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,19 @@ pub trait Base: Debug {
7676
/// * `StoreError::RepositoryConflict`
7777
fn update_repository(&mut self, repository: Repository) -> StoreResult<()>;
7878

79+
/// Find first by name in the given repository
7980
fn get_pacbuild_by_name_and_url(&self, name: &str, repository_url: &str) -> Option<&PacBuild>;
81+
82+
/// Find repository by name
8083
fn get_repository_by_name(&self, name: &str) -> Option<&Repository>;
84+
/// Find repository by url
8185
fn get_repository_by_url(&self, url: &str) -> Option<&Repository>;
86+
87+
/// Find all repositories
8288
fn get_all_repositories(&self) -> Vec<&Repository>;
8389

90+
/// Find all packages that match all the given params. `None` params are
91+
/// skipped.
8492
fn get_all_pacbuilds_by(
8593
&self,
8694
name_like: Option<&str>,
@@ -91,6 +99,7 @@ pub trait Base: Debug {
9199
}
92100

93101
impl dyn Base {
102+
/// Find all pacbuilds from all repositories
94103
pub fn get_all_pacbuilds(&self) -> Vec<&PacBuild> {
95104
self.get_all_pacbuilds_by(None, None, None, None)
96105
}

0 commit comments

Comments
 (0)