add request_boxed_we
This commit is contained in:
parent
7332c04e53
commit
73cf59afb8
@ -154,11 +154,10 @@ impl<M: fmt::Debug + 'static, E: StdSyncSendError> Error<M, E> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn try_unwrap(self) -> Option<E> {
|
||||
pub fn try_unwrap(self) -> Result<E, Self> {
|
||||
match self {
|
||||
Error::Other(inner) => Some(inner),
|
||||
Error::OtherBoxed(_) => None,
|
||||
_ => None,
|
||||
Error::Other(inner) => Ok(inner),
|
||||
s => Err(s),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
12
src/lib.rs
12
src/lib.rs
@ -88,7 +88,6 @@ impl Bus {
|
||||
pub(crate) fn init(&self) {
|
||||
for (_, rs) in &self.inner.receivers {
|
||||
for r in rs {
|
||||
println!("init {}", r.name());
|
||||
r.init(self).unwrap();
|
||||
}
|
||||
}
|
||||
@ -245,13 +244,6 @@ impl Bus {
|
||||
return Err(SendError::Closed(msg).into());
|
||||
}
|
||||
|
||||
for r in &self.inner.receivers {
|
||||
println!("{:?}: ", r.0);
|
||||
for i in r.1 {
|
||||
println!(" {:?}: ", i.name());
|
||||
}
|
||||
}
|
||||
|
||||
let tt = msg.type_tag();
|
||||
let mid = ID_COUNTER.fetch_add(1, Ordering::Relaxed);
|
||||
|
||||
@ -531,7 +523,7 @@ impl Bus {
|
||||
_options: SendOptions,
|
||||
) -> Result<(), Error<Box<dyn Message>>> {
|
||||
if self.inner.closed.load(Ordering::SeqCst) {
|
||||
println!("closed message bus");
|
||||
warn!("closed message bus");
|
||||
return Err(Error::NoResponse);
|
||||
}
|
||||
|
||||
@ -552,7 +544,7 @@ impl Bus {
|
||||
options: SendOptions,
|
||||
) -> Result<Box<dyn Message>, Error<Box<dyn Message>>> {
|
||||
if self.inner.closed.load(Ordering::SeqCst) {
|
||||
println!("closed message bus");
|
||||
warn!("closed message bus");
|
||||
return Err(Error::NoResponse);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user