diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-04-09 13:11:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-09 13:11:25 -0400 |
commit | d2579f45641b437974829c87d58c2a362ef66919 (patch) | |
tree | b1340c30daade103f6be9db1de6d7d4fad199a9c /core/modules.rs | |
parent | e43da28b28c8b1ed97da603ec0e6bf91fbb67798 (diff) |
core: Rename Behavior to Dispatch (#2082)
And rename IsolateState to ThreadSafeState.
Also make ThreadSafeState directly implement Dispatch. This is simpler.
Diffstat (limited to 'core/modules.rs')
-rw-r--r-- | core/modules.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/modules.rs b/core/modules.rs index b013b8655..7a9b0a3b2 100644 --- a/core/modules.rs +++ b/core/modules.rs @@ -18,7 +18,7 @@ use std::collections::HashMap; pub type SourceCodeFuture<E> = dyn Future<Item = String, Error = E> + Send; pub trait Loader { - type Behavior: crate::isolate::Behavior; + type Dispatch: crate::isolate::Dispatch; type Error: std::error::Error + 'static; /// Returns an absolute URL. @@ -32,9 +32,9 @@ pub trait Loader { fn isolate_and_modules<'a: 'b + 'c, 'b, 'c>( &'a mut self, - ) -> (&'b mut Isolate<Self::Behavior>, &'c mut Modules); + ) -> (&'b mut Isolate<Self::Dispatch>, &'c mut Modules); - fn isolate<'a: 'b, 'b>(&'a mut self) -> &'b mut Isolate<Self::Behavior> { + fn isolate<'a: 'b, 'b>(&'a mut self) -> &'b mut Isolate<Self::Dispatch> { let (isolate, _) = self.isolate_and_modules(); isolate } @@ -262,14 +262,14 @@ mod tests { struct MockLoader { pub loads: Vec<String>, - pub isolate: Isolate<TestBehavior>, + pub isolate: Isolate<TestDispatch>, pub modules: Modules, } impl MockLoader { fn new() -> Self { let modules = Modules::new(); - let isolate = TestBehavior::setup(TestBehaviorMode::AsyncImmediate); + let isolate = TestDispatch::setup(TestDispatchMode::AsyncImmediate); Self { loads: Vec::new(), isolate, @@ -279,7 +279,7 @@ mod tests { } impl Loader for MockLoader { - type Behavior = TestBehavior; + type Dispatch = TestDispatch; type Error = std::io::Error; fn resolve(specifier: &str, _referrer: &str) -> String { @@ -304,7 +304,7 @@ mod tests { fn isolate_and_modules<'a: 'b + 'c, 'b, 'c>( &'a mut self, - ) -> (&'b mut Isolate<Self::Behavior>, &'c mut Modules) { + ) -> (&'b mut Isolate<Self::Dispatch>, &'c mut Modules) { (&mut self.isolate, &mut self.modules) } } |