Skip to content

Commit

Permalink
src/trigger.rs: Add scaffolding to deserialize a Trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
livingsilver94 committed Sep 13, 2023
1 parent 9e7b818 commit 682a69a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/trigger.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
use ion_rs::element::reader::ElementReader;
use ion_rs::Reader;
use thiserror::Error;

/// Env describes a special status the operating system
/// may be in. Some Triggers are not allowed to run in certain
/// environments.
Expand Down Expand Up @@ -34,3 +38,17 @@ pub struct Trigger {
/// Tasks that this trigger can perform.
tasks: Vec<Task>,
}

impl TryFrom<Reader<'_>> for Trigger {
type Error = Error;

fn try_from(mut reader: Reader) -> Result<Self, Self::Error> {
for element in reader.elements() {
todo!()
}
todo!()
}
}

#[derive(Error, Debug)]
pub enum Error {}

0 comments on commit 682a69a

Please sign in to comment.