Make Event trait Send+Sync.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-07-08 11:50:54 +00:00
parent b0315da3d7
commit 8244d78cb2
15 changed files with 27 additions and 25 deletions

View File

@@ -38,7 +38,7 @@ pub(super) async fn fetch_and_handle_outliers<'a, Pdu, Events>(
room_id: &'a RoomId,
) -> Vec<(PduEvent, Option<BTreeMap<String, CanonicalJsonValue>>)>
where
Pdu: Event + Send + Sync,
Pdu: Event,
Events: Iterator<Item = &'a EventId> + Clone + Send,
{
let back_off = |id| match self

View File

@@ -35,7 +35,7 @@ pub(super) async fn fetch_prev<'a, Pdu, Events>(
HashMap<OwnedEventId, (PduEvent, BTreeMap<String, CanonicalJsonValue>)>,
)>
where
Pdu: Event + Send + Sync,
Pdu: Event,
Events: Iterator<Item = &'a EventId> + Clone + Send,
{
let num_ids = initial_set.clone().count();

View File

@@ -26,7 +26,7 @@ pub(super) async fn fetch_state<Pdu>(
event_id: &EventId,
) -> Result<Option<HashMap<u64, OwnedEventId>>>
where
Pdu: Event + Send + Sync,
Pdu: Event,
{
let res = self
.services

View File

@@ -24,7 +24,7 @@ pub(super) async fn handle_outlier_pdu<'a, Pdu>(
auth_events_known: bool,
) -> Result<(PduEvent, BTreeMap<String, CanonicalJsonValue>)>
where
Pdu: Event + Send + Sync,
Pdu: Event,
{
// 1. Remove unsigned field
value.remove("unsigned");

View File

@@ -29,7 +29,7 @@ pub(super) async fn handle_prev_pdu<'a, Pdu>(
prev_id: &'a EventId,
) -> Result
where
Pdu: Event + Send + Sync,
Pdu: Event,
{
// Check for disabled again because it might have changed
if self.services.metadata.is_disabled(room_id).await {

View File

@@ -24,7 +24,7 @@ pub(super) async fn state_at_incoming_degree_one<Pdu>(
incoming_pdu: &Pdu,
) -> Result<Option<HashMap<u64, OwnedEventId>>>
where
Pdu: Event + Send + Sync,
Pdu: Event,
{
let prev_event = incoming_pdu
.prev_events()
@@ -80,7 +80,7 @@ pub(super) async fn state_at_incoming_resolved<Pdu>(
room_version_id: &RoomVersionId,
) -> Result<Option<HashMap<u64, OwnedEventId>>>
where
Pdu: Event + Send + Sync,
Pdu: Event,
{
trace!("Calculating extremity statehashes...");
let Ok(extremity_sstatehashes) = incoming_pdu

View File

@@ -26,7 +26,7 @@ pub(super) async fn upgrade_outlier_to_timeline_pdu<Pdu>(
room_id: &RoomId,
) -> Result<Option<RawPduId>>
where
Pdu: Event + Send + Sync,
Pdu: Event,
{
// Skip the PDU if we already have it as a timeline event
if let Ok(pduid) = self