Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add missing public types in documentation #103

Merged
merged 1 commit into from Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/error.rs
@@ -1,12 +1,15 @@
use std::{error, fmt};

/// A cron error
#[derive(Debug)]
pub struct Error {
kind: ErrorKind,
}

/// The kind of cron error that occurred
#[derive(Debug)]
pub enum ErrorKind {
/// Failed to parse an expression
Expression(String),
}

Expand Down
4 changes: 3 additions & 1 deletion src/lib.rs
Expand Up @@ -34,13 +34,15 @@
//! */
//! ```

/// Error types used by this crate.
pub mod error;

mod schedule;
mod time_unit;
mod ordinal;
mod specifier;
mod queries;
mod parsing;

pub use crate::schedule::Schedule;
pub use crate::schedule::{Schedule, ScheduleIterator};
pub use crate::time_unit::TimeUnitSpec;
4 changes: 3 additions & 1 deletion src/schedule.rs
Expand Up @@ -14,6 +14,7 @@ impl From<Schedule> for String {
}
}

/// Representation of a cron expression
#[derive(Clone, Debug, Eq)]
pub struct Schedule {
source: String,
Expand Down Expand Up @@ -332,6 +333,7 @@ impl ScheduleFields {
}
}

/// Iterates `DateTime` occurrences of a schedule.
pub struct ScheduleIterator<'a, Z>
where
Z: TimeZone,
Expand Down Expand Up @@ -563,7 +565,7 @@ mod test {
let prev = schedule.after(&dt).rev().next().unwrap();
assert!(prev < dt); // test is ensuring line above does not panic
}

#[test]
fn test_time_unit_spec_equality() {
let schedule_1 = Schedule::from_str("@weekly").unwrap();
Expand Down