Skip to content

Commit

Permalink
[skip ci] docs: Move module-level docs to their respective module files
Browse files Browse the repository at this point in the history
  • Loading branch information
proudmuslim-dev committed Feb 28, 2022
1 parent d8c000b commit 11c999e
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 23 deletions.
3 changes: 3 additions & 0 deletions github-rest/src/builders/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! This module includes various builders for Methods that require a lot of
//! information

use crate::{GithubRestError, Requester};
use async_trait::async_trait;
pub use commits::*;
Expand Down
4 changes: 4 additions & 0 deletions github-rest/src/client.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//! This module contains a pre-built client you can use instead of making your
//! own client. you can still do this though by implementing the [`Requester`]
//! trait

use std::fmt::Display;
//TODO: lock this behind a feature
//TODO: Replace all Strings with T: into<String>
Expand Down
14 changes: 2 additions & 12 deletions github-rest/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![deny(rust_2018_idioms)]

use core::fmt;
use std::error::Error;

Expand All @@ -7,23 +8,12 @@ pub use github_api::end_points;
use github_api::end_points::EndPoints;
use reqwest::{Body, StatusCode};
use serde::{de::DeserializeOwned, Serialize};

#[cfg(feature = "builders")]
/// This module includes various builders for Methods that require a lot of
/// information
pub mod builders;
#[cfg(feature = "client")]
/// This module contains a pre-built client you can use instead of making your
/// own client. you can still do this though by implementing the [`Requester`]
/// trait
pub mod client;
/// This module contains helper functions for writing API requests.
pub mod methods;
/// This module contains all API request/response types currently implemented.
/// These include:
/// * Webhook payloads
/// - Webhook payloads can be found at `./<directory>/events.rs`
/// * Request bodies
/// * Response bodies
pub mod model;

#[derive(Debug)]
Expand Down
2 changes: 2 additions & 0 deletions github-rest/src/methods/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! This module contains helper functions for writing API requests.

pub use commits::*;
pub use issues::*;
pub use misc::*;
Expand Down
4 changes: 2 additions & 2 deletions github-rest/src/model/misc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ pub mod deployments {
// TODO: Create enum repr for this field.
/// Can either be a [`User`] or [`Organization`]
///
/// [`User`]: github_rest::model::User
/// [`Organization`]: github_rest::model::organizations::Organization
/// [`User`]: crate::model::User
/// [`Organization`]: crate::model::organizations::Organization
pub account: Value,
pub billing_cycle: MarketplaceBillingCycle,
pub unit_count: usize,
Expand Down
7 changes: 7 additions & 0 deletions github-rest/src/model/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
//! This module contains all API request/response types currently implemented.
//! These include:
//! * Webhook payloads
//! - Webhook payloads can be found at `./<directory>/events.rs`
//! * Request bodies
//! * Response bodies

// Temporary
#![allow(clippy::module_inception)]

Expand Down
3 changes: 3 additions & 0 deletions octocat-rs/src/github/client.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Contains the [`GitHubClient`] trait and its default implementation
//! ([`Client`]).

use std::{fmt::Debug, sync::Arc};

use anyhow::Result;
Expand Down
2 changes: 2 additions & 0 deletions octocat-rs/src/github/client_builder.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Contains a builder for [`Client`].

use std::{ffi::OsStr, fs::File, io::prelude::*, path::Path};

use anyhow::{Error, Result};
Expand Down
2 changes: 2 additions & 0 deletions octocat-rs/src/github/command.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Contains the [`Command`] interface used in the event [`handler`].

use std::fmt::Debug;

use futures::{
Expand Down
3 changes: 3 additions & 0 deletions octocat-rs/src/github/handler.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Contains the [`EventHandler`] trait and its default implementation
//! ([`DefaultEventHandler`]).

use std::sync::Arc;

use async_trait::async_trait;
Expand Down
2 changes: 2 additions & 0 deletions octocat-rs/src/github/http.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Contains [`HttpClient`].

use async_trait::async_trait;
use reqwest::{
header,
Expand Down
9 changes: 0 additions & 9 deletions octocat-rs/src/github/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,11 @@ pub use handler::*;
pub use http::*;
pub use util::*;

/// Contains the [`GitHubClient`] trait and its default implementation
/// ([`Client`]).
pub mod client;
/// Contains a builder for [`Client`].
pub mod client_builder;
/// Contains the [`Command`] interface used in the event [`handler`].
pub mod command;
/// Contains the [`EventHandler`] trait and its default implementation
/// ([`DefaultEventHandler`]).
pub mod handler;
/// Contains [`HttpClient`].
pub mod http;
/// Miscellaneous utilities including the [`OctocatConfig`] struct and
/// [`Authorization`] enum.
pub mod util;

#[cfg(test)]
Expand Down
3 changes: 3 additions & 0 deletions octocat-rs/src/github/util.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Miscellaneous utilities including the [`OctocatConfig`] struct and
//! [`Authorization`] enum.

use serde::{Deserialize, Serialize};
use thiserror::Error;

Expand Down

0 comments on commit 11c999e

Please sign in to comment.