Skip to content

Commit

Permalink
Rename Worker trait to Bridged
Browse files Browse the repository at this point in the history
To avoid conflicts with the same name of an implementation
  • Loading branch information
therustmonk committed Jun 8, 2018
1 parent 41a22eb commit 0174acf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ pub struct HandlerId(usize);
type HandlersPool<T> = Rc<RefCell<Slab<Callback<T>>>>;

/// This traits allow to get addres or register worker.
// TODO Maybe use somethig like `App` for `Component`s.
pub trait Worker: Agent + Sized + 'static {
pub trait Bridged: Agent + Sized + 'static {
/// Creates a messaging bridge between a worker and the component.
fn bridge(callback: Callback<Self::Output>) -> Box<Bridge<Self>>;
}
Expand Down Expand Up @@ -114,7 +113,7 @@ where
}
}

impl<T> Worker for T
impl<T> Bridged for T
where
T: Agent,
{
Expand Down
4 changes: 2 additions & 2 deletions src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ pub use stdweb::web::event::{
pub use agent::{
Ambit,
Bridge,
Worker,
Threaded,
Bridged,
};

/// Prelude module for creating worker.
Expand All @@ -58,6 +58,6 @@ pub mod worker {
Private,
Public,
Transferable,
Worker,
Bridged,
};
}

0 comments on commit 0174acf

Please sign in to comment.