-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: implementations for structs
- Loading branch information
1 parent
845e750
commit 6df19a9
Showing
4 changed files
with
106 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,29 @@ | ||
use wasm_bindgen::prelude::*; | ||
|
||
use super::frequency::StFrequencyType; | ||
use crate::scheduler::frequency::StFrequencyType; | ||
|
||
#[wasm_bindgen] | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
pub struct StCronSchedule { | ||
expression: String, | ||
frequency: StFrequencyType, | ||
} | ||
|
||
#[wasm_bindgen] | ||
impl StCronSchedule { | ||
#[wasm_bindgen(constructor)] | ||
pub fn new(expression: String, frequency: StFrequencyType) -> Self { | ||
StCronSchedule { | ||
expression, | ||
frequency, | ||
} | ||
} | ||
|
||
pub fn get_expression(&self) -> String { | ||
self.expression.clone() | ||
} | ||
|
||
pub fn get_frequency(&self) -> StFrequencyType { | ||
self.frequency | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ pub mod frequency; | |
pub mod priority; | ||
pub mod schedule; | ||
pub mod scheduler; | ||
pub mod time; | ||
pub mod time; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters