I'm unable to return errors from my syslog thread (not using the log framework) because the errors don't implement Sync:
match syslog.info(alert_message)
{
Ok(_) => Ok(()),
Err(e) => Err(Box::new(e)),
}
error[E0277]: `(dyn StdError + std::marker::Send + 'static)` cannot be shared between threads safely
--> src/alerts/common.rs:185:35
|
185 | Err(e) => Err(Box::new(e)),
| --- ^^^^^^^^^^^ `(dyn StdError + std::marker::Send + 'static)` cannot be shared between threads safely
| |
| required by a bound introduced by this call
|
= help: the trait `Sync` is not implemented for `(dyn StdError + std::marker::Send + 'static)`
= note: required because of the requirements on the impl of `Sync` for `Unique<(dyn StdError + std::marker::Send + 'static)>`
= note: required because it appears within the type `Box<(dyn StdError + std::marker::Send + 'static)>`
= note: required because it appears within the type `std::option::Option<Box<(dyn StdError + std::marker::Send + 'static)>>`
= note: required because it appears within the type `error_chain::State`
= note: required because it appears within the type `syslog::Error`
= note: required for the cast to the object type `dyn StdError + Sync + std::marker::Send`
I'm unable to return errors from my syslog thread (not using the
log
framework) because the errors don't implement Sync:Could the Sync trait be added?