Hi, I've recently started using scraper for a project and I've come to realize that, no matter whether I'm cascading back up Err
s from a separate thread or from the main thread, I always get a compile-time error about an Rc
I assume scraper uses internally (based on other complementary information given by the error,) and I was wondering if there was something I might be missing about this error type.
At first, when trying it out in a separate thread, I assumed it was right for the error to pop up as I can't make any guarantees I won't move it around threads, and would thus require for scraper to use Arc
. But when I tried it out in the main thread with no explicit concurrency/parallelism whatsoever, it still errored out with the same report about thread safety.
Reading the docs, it seems it's explicitly not Send
nor Sync
, but that shouldn't stop it from cascading back up a callback with the ?
operator, right? Maybe that's were my assumptions are wrong, but I can't say for certain.
Though maybe it's due to the fact I'm using it in the main thread, but as a consequence of receiving a message through the receiver in an mpsc
channel. Still, that shouldn't really have any implications if the receiver is being used in the main thread like any other constructs. Though then again, I might be wrong in assuming so.
I'm just really confused about the reason why the thread-safety error pops up. Maybe it's because the main thread is not that special, and using a non-Send
and a non-Sync
type after already having spawned another thread for some other apparently unrelated reason, still triggers an error about possibly passing around between threads (just in case.) If so, is there some way of assuring the compiler/bounding that it won't get tossed around, the way it's done with lifetimes and references in their respective context?
Thanks.