Skip to main content

Module timeline

Module timeline 

Source
Expand description

Stores accepted room events, outliers, and their timeline indexes.

The service maps event IDs to per-room stream positions, presents events to users, and coordinates append, backfill, purge, and redaction operations. Timeline insertion is serialized by the innermost per-room lock.

Re-exportsΒ§

use std::fmt::Write; πŸ”’
use std::sync::Arc; πŸ”’
use async_trait::async_trait; πŸ”’
use futures::FutureExt; πŸ”’
use futures::StreamExt; πŸ”’
use futures::TryFutureExt; πŸ”’
use futures::TryStreamExt; πŸ”’
use futures::future::Either; πŸ”’
use futures::future::select; πŸ”’
use futures::future::select_ok; πŸ”’
use futures::future::try_join; πŸ”’
use futures::pin_mut; πŸ”’
use ruma::CanonicalJsonObject; πŸ”’
use ruma::EventId; πŸ”’
use ruma::MilliSecondsSinceUnixEpoch; πŸ”’
use ruma::OwnedEventId; πŸ”’
use ruma::OwnedRoomId; πŸ”’
use ruma::RoomId; πŸ”’
use ruma::UserId; πŸ”’
use ruma::api::Direction; πŸ”’
use ruma::events::room::encrypted::Relation; πŸ”’
use ruma::signatures::Verified; πŸ”’
use serde::Deserialize; πŸ”’
use serde::Deserialize; πŸ”’
use tuwunel_core::Err; πŸ”’
use tuwunel_core::Error; πŸ”’
use tuwunel_core::Result; πŸ”’
use tuwunel_core::at; πŸ”’
use tuwunel_core::err; πŸ”’
use tuwunel_core::implement; πŸ”’
use tuwunel_core::utils::MutexMap; πŸ”’
use tuwunel_core::utils::MutexMapGuard; πŸ”’
use tuwunel_core::utils::future::TryExtExt; πŸ”’
use tuwunel_core::utils::result::LogErr; πŸ”’
use tuwunel_core::utils::result::NotFound; πŸ”’
use tuwunel_core::utils::stream::IterStream; πŸ”’
use tuwunel_core::utils::stream::TryReadyExt; πŸ”’
use tuwunel_core::warn; πŸ”’
use tuwunel_database::Database; πŸ”’
use tuwunel_database::Deserialized; πŸ”’
use tuwunel_database::Json; πŸ”’
use tuwunel_database::Map; πŸ”’
use tuwunel_database::Txn; πŸ”’
use tuwunel_matrix::ShortEventId; πŸ”’
use tuwunel_matrix::pdu::PduCount; πŸ”’
use tuwunel_matrix::pdu::PduEvent; πŸ”’
use tuwunel_matrix::room::state::resolution::FetchEvent; πŸ”’
pub use self::build::Collision;
pub use self::pdus::PdusIterItem;
pub use self::pdus::bias_count;
pub(crate) use self::append::Incoming; πŸ”’
pub(crate) use self::checked::Mapped; πŸ”’
pub(crate) use self::checked::Position; πŸ”’
pub(crate) use self::redact::Restoration; πŸ”’
use crate::rooms::short::ShortRoomId; πŸ”’
use crate::rooms::short::ShortStateHash; πŸ”’
use crate::rooms::threads::RedactedRoot; πŸ”’

ModulesΒ§

append πŸ”’
Appends authenticated events to room timelines and applies their side effects.
backfill πŸ”’
Retrieves older room history from federation and inserts validated events.
build πŸ”’
Builds and appends locally authored room events.
checked πŸ”’
Check-only reads of timeline events.
create πŸ”’
Constructs and signs local room events without persisting them.
pdus πŸ”’
Streams, indexes, and deletes accepted room timeline rows.
purge πŸ”’
Selectively removes historical accepted events from a room timeline.
redact πŸ”’
Replaces accepted timeline events with their room-version redacted form.

StructsΒ§

Data πŸ”’
ExtractBody πŸ”’
ExtractEventId πŸ”’
ExtractRelatesTo πŸ”’
Extracts the relation carried by event content.
ExtractRelatesToEventId πŸ”’
PduId
Re-exports the typed and raw persistent timeline identifiers.
Service
Provides persistent event lookup, insertion, and room timeline traversal.

EnumsΒ§

RawPduId
Re-exports the typed and raw persistent timeline identifiers.

Type AliasesΒ§

RoomMutexGuard
Guard proving exclusive access to a room’s timeline insertion path.
RoomMutexMap πŸ”’