Skip to content

Commit

Permalink
we start asking for FASTN.ftd file
Browse files Browse the repository at this point in the history
  • Loading branch information
amitu committed Dec 8, 2024
1 parent 5732434 commit ef97bde
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
6 changes: 6 additions & 0 deletions v0.5/fastn-continuation/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ pub enum Result<C: fastn_continuation::Continuation + ?Sized> {
Done(C::Output),
}

impl<C: fastn_continuation::Continuation + Default> Default for Result<C> {
fn default() -> Self {
Result::Init(Box::default())
}
}

impl<C: fastn_continuation::Continuation> Result<C>
where
C::Found: Default,
Expand Down
12 changes: 2 additions & 10 deletions v0.5/fastn-package/src/reader.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Debug)]
#[derive(Debug, Default)]
pub struct State {
name: String,
systems: Vec<fastn_package::UR<String, fastn_package::System>>,
Expand All @@ -8,16 +8,8 @@ pub struct State {
}

impl fastn_package::Package {
// s: FASTN.ftd source code
pub fn reader() -> fastn_continuation::Result<State> {
// TODO: lets make as much progress as we can
fastn_continuation::Result::Init(Box::new(State {
name: "".to_string(),
systems: vec![],
dependencies: vec![],
auto_imports: vec![],
apps: vec![],
}))
fastn_continuation::Result::Stuck(Default::default(), vec!["FASTN.ftd".to_string()])
}
}

Expand Down
4 changes: 2 additions & 2 deletions v0.5/fastn-router/src/reader.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#[derive(Default)]
pub struct State {}

impl fastn_router::Router {
pub fn reader() -> fastn_continuation::Result<State> {
// TODO: lets make as much progress as we can
fastn_continuation::Result::Stuck(Box::new(State {}), Default::default())
fastn_continuation::Result::Stuck(Default::default(), vec!["FASTN.ftd".to_string()])
}
}

Expand Down

0 comments on commit ef97bde

Please sign in to comment.