caio.co/de/foca

Ensure wrapped errors are Sync

Id
5c8f33d8d658a774a8a70387f46e44ccd35f96c3
Author
Caio
Commit time
2025-09-19T09:51:55+02:00

Modified CHANGELOG.md

@@ -1,5 +1,9
# Changelog

+## UNRELEASED
+
+- Foca errors are now Sync
+
## v0.19.0 - 2025-03-24

- `rand` dependency updated to 0.9

Modified src/broadcast.rs

@@ -21,7 +21,7

/// The error type that `receive_item` may emit. Will be wrapped
/// by [`crate::Error::CustomBroadcast`].
- type Error: core::error::Error + Send + 'static;
+ type Error: core::error::Error + Send + Sync + 'static;

/// Decodes a [`Self::Key`] from a buffer and either discards
/// it or tells Foca to persist and disseminate it.

Modified src/error.rs

@@ -65,17 +65,17
/// codec.
///
/// Might have left Foca in a inconsistent state.
- Encode(Box<dyn core::error::Error + Send>),
+ Encode(Box<dyn core::error::Error + Send + Sync>),

/// Wraps [`crate::Codec`]'s `decode_*` failures.
///
/// Can happen during normal operation when receiving junk data.
- Decode(Box<dyn core::error::Error + Send>),
+ Decode(Box<dyn core::error::Error + Send + Sync>),

/// Wraps [`crate::BroadcastHandler`] failures.
///
/// Doesn't affect Foca's state.
- CustomBroadcast(Box<dyn core::error::Error + Send>),
+ CustomBroadcast(Box<dyn core::error::Error + Send + Sync>),

/// Configuration change not allowed.
///