Skip to content

Commit

Permalink
WIP: local state
Browse files Browse the repository at this point in the history
  • Loading branch information
kmicklas committed Jun 11, 2024
1 parent 7cc7a3e commit ab78aa2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ravel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ use std::{marker::PhantomData, mem::MaybeUninit};

use paste::paste;

mod state;

pub use state::*;

/// A dummy type which typically represents a "backend".
pub trait CxRep {
type BuildCx<'a>: Copy;
Expand Down
15 changes: 15 additions & 0 deletions ravel/src/state.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use std::cell::RefCell;

use crate::Token;

pub struct WithState<T, Init, Build> {}

pub fn with_state<T, Init, Build, S>(
init: Init,
build: Build,
) -> WithState<T, Init, Build>
where
Init: FnOnce() -> T,
Build: FnOnce(&RefCell<T>) -> Token<S>,
{
}

0 comments on commit ab78aa2

Please sign in to comment.