some missing From impls

This commit is contained in:
Robin Müller 2022-11-12 23:13:55 +01:00
parent 9421465ffe
commit cf556a407f
No known key found for this signature in database
GPG Key ID: BE6480244DFE612C
2 changed files with 21 additions and 0 deletions

View File

@ -197,12 +197,31 @@ pub struct StateAccepted;
#[derive(Copy, Clone, Debug, Eq, PartialEq)] #[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct StateStarted; pub struct StateStarted;
#[derive(Debug, Eq, PartialEq)]
pub enum StateToken { pub enum StateToken {
None(StateNone), None(StateNone),
Accepted(StateAccepted), Accepted(StateAccepted),
Started(StateStarted), Started(StateStarted),
} }
impl From<StateNone> for StateToken {
fn from(t: StateNone) -> Self {
StateToken::None(t)
}
}
impl From<StateAccepted> for StateToken {
fn from(t: StateAccepted) -> Self {
StateToken::Accepted(t)
}
}
impl From<StateStarted> for StateToken {
fn from(t: StateStarted) -> Self {
StateToken::Started(t)
}
}
impl<STATE> VerificationToken<STATE> { impl<STATE> VerificationToken<STATE> {
fn new(req_id: RequestId) -> VerificationToken<StateNone> { fn new(req_id: RequestId) -> VerificationToken<StateNone> {
VerificationToken { VerificationToken {

View File

@ -63,6 +63,8 @@ impl PusServiceProvider for PusReceiver {
drop(reporter); drop(reporter);
if service == 17 { if service == 17 {
self.handle_test_service(pus_tc, accepted_token); self.handle_test_service(pus_tc, accepted_token);
} else if service == 5 {
// TODO: Send message to event manager here
} }
Ok(()) Ok(())
} }