summaryrefslogtreecommitdiff
path: root/core/ops.rs
diff options
context:
space:
mode:
Diffstat (limited to 'core/ops.rs')
-rw-r--r--core/ops.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/ops.rs b/core/ops.rs
index 42718b8ff..b936fc726 100644
--- a/core/ops.rs
+++ b/core/ops.rs
@@ -3,6 +3,7 @@
use crate::gotham_state::GothamState;
use crate::resources::ResourceTable;
use crate::runtime::GetErrorClassFn;
+use crate::OpDecl;
use crate::OpsTracker;
use anyhow::Error;
use futures::future::maybe_done;
@@ -12,10 +13,12 @@ use futures::ready;
use futures::task::noop_waker;
use futures::Future;
use serde::Serialize;
+use std::cell::RefCell;
use std::cell::UnsafeCell;
use std::ops::Deref;
use std::ops::DerefMut;
use std::pin::Pin;
+use std::rc::Rc;
use std::task::Context;
use std::task::Poll;
@@ -134,6 +137,13 @@ pub fn to_op_result<R: Serialize + 'static>(
}
}
+// TODO(@AaronO): optimize OpCtx(s) mem usage ?
+pub struct OpCtx {
+ pub id: OpId,
+ pub state: Rc<RefCell<OpState>>,
+ pub decl: OpDecl,
+}
+
/// Maintains the resources and ops inside a JS runtime.
pub struct OpState {
pub resource_table: ResourceTable,