Add StoreAction enum type for store unload hook
This commit is contained in:
parent
bebb3a3712
commit
e9ce659ce8
1 changed files with 16 additions and 12 deletions
|
@ -26,25 +26,28 @@ pub enum StoreAction {
|
|||
Retrieve,
|
||||
Update,
|
||||
Delete,
|
||||
StoreUnload,
|
||||
}
|
||||
|
||||
impl StoreAction {
|
||||
|
||||
pub fn uppercase(&self) -> &str {
|
||||
match *self {
|
||||
StoreAction::Create => "CREATE",
|
||||
StoreAction::Retrieve => "RETRIEVE",
|
||||
StoreAction::Update => "UPDATE",
|
||||
StoreAction::Delete => "DELETE",
|
||||
StoreAction::Create => "CREATE",
|
||||
StoreAction::Retrieve => "RETRIEVE",
|
||||
StoreAction::Update => "UPDATE",
|
||||
StoreAction::Delete => "DELETE",
|
||||
StoreAction::StoreUnload => "STORE UNLOAD",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn as_commit_message(&self) -> &str {
|
||||
match *self {
|
||||
StoreAction::Create => "Create",
|
||||
StoreAction::Retrieve => "Retrieve",
|
||||
StoreAction::Update => "Update",
|
||||
StoreAction::Delete => "Delete",
|
||||
StoreAction::Create => "Create",
|
||||
StoreAction::Retrieve => "Retrieve",
|
||||
StoreAction::Update => "Update",
|
||||
StoreAction::Delete => "Delete",
|
||||
StoreAction::StoreUnload => "Store Unload",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,10 +57,11 @@ impl Display for StoreAction {
|
|||
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error> {
|
||||
write!(fmt, "StoreAction: {}",
|
||||
match *self {
|
||||
StoreAction::Create => "create",
|
||||
StoreAction::Retrieve => "retrieve",
|
||||
StoreAction::Update => "update",
|
||||
StoreAction::Delete => "delete",
|
||||
StoreAction::Create => "create",
|
||||
StoreAction::Retrieve => "retrieve",
|
||||
StoreAction::Update => "update",
|
||||
StoreAction::Delete => "delete",
|
||||
StoreAction::StoreUnload => "store unload",
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue