pub struct Data {
servercurrentevent_data: Arc<Map>,
servernameevent_data: Arc<Map>,
servername_educount: Arc<Map>,
servershortroomid_park: Arc<Map>,
pub(super) db: Arc<Database>,
services: Arc<OnceServices>,
}Expand description
The sending service’s column families.
Queued rows wait in servernameevent_data until a transaction claims them
into servercurrentevent_data; servername_educount is the per-server EDU
watermark, and servershortroomid_park holds rooms a server keeps
rejecting.
Fields§
§servercurrentevent_data: Arc<Map>§servernameevent_data: Arc<Map>§servername_educount: Arc<Map>§servershortroomid_park: Arc<Map>§db: Arc<Database>§services: Arc<OnceServices>Implementations§
Source§impl Data
impl Data
Sourcepub(super) fn delete_active_requests<'a, I>(&self, keys: I)
pub(super) fn delete_active_requests<'a, I>(&self, keys: I)
Acknowledges the active rows one transaction carried.
Empty keys mark synthetic events, which have no row.
Source§impl Data
impl Data
pub(super) async fn delete_all_requests_for(&self, destination: &Destination)
Source§impl Data
impl Data
pub(super) fn mark_as_active<'a, I>(&self, events: I)
Source§impl Data
impl Data
Sourcepub(super) fn persist_active_edus(
&self,
server: &ServerName,
edus: &[EduBuf],
) -> IntoIter<Vec<u8>> ⓘ
pub(super) fn persist_active_edus( &self, server: &ServerName, edus: &[EduBuf], ) -> IntoIter<Vec<u8>> ⓘ
Write composed EDUs straight into the active set, keyed by fresh counts.
Unlike mark_as_active there is no queue row to delete. Yields the new
keys in edus order for the transaction to acknowledge.
Source§impl Data
impl Data
Sourcepub fn active_requests(
&self,
) -> impl Stream<Item = (Vec<u8>, SendingEvent, Destination)> + Send + '_
pub fn active_requests( &self, ) -> impl Stream<Item = (Vec<u8>, SendingEvent, Destination)> + Send + '_
Streams every active row across all destinations.
Rows are decoded as they are read; a row that fails to decode is a corrupt database and panics.
Source§impl Data
impl Data
Sourcepub fn active_requests_for(
&self,
destination: &Destination,
) -> impl Stream<Item = (Vec<u8>, SendingEvent)> + Send + '_ + use<'_>
pub fn active_requests_for( &self, destination: &Destination, ) -> impl Stream<Item = (Vec<u8>, SendingEvent)> + Send + '_ + use<'_>
Streams the active rows of one destination.
Rows are decoded as they are read; a row that fails to decode is a corrupt database and panics.
Source§impl Data
impl Data
Sourcepub(super) fn retain_queued<'a, I>(
&'a self,
events: I,
) -> impl Stream<Item = (Vec<u8>, SendingEvent)> + Send + 'a
pub(super) fn retain_queued<'a, I>( &'a self, events: I, ) -> impl Stream<Item = (Vec<u8>, SendingEvent)> + Send + 'a
Yields only pending queue items.
Empty-key payload wakes always pass because they have no durable row. A wake can outlive its row after a completed drain delivered the event.
Source§impl Data
impl Data
Sourcepub fn queued_requests(
&self,
destination: &Destination,
) -> impl Stream<Item = (Vec<u8>, SendingEvent)> + Send + '_ + use<'_>
pub fn queued_requests( &self, destination: &Destination, ) -> impl Stream<Item = (Vec<u8>, SendingEvent)> + Send + '_ + use<'_>
Streams the queued rows of one destination.
Rows are decoded as they are read; a row that fails to decode is a corrupt database and panics.
Source§impl Data
impl Data
Sourcepub(super) fn queued_room(
&self,
destination: &Destination,
room: ShortRoomId,
) -> impl Stream<Item = (Vec<u8>, SendingEvent)> + Send + '_ + use<'_>
pub(super) fn queued_room( &self, destination: &Destination, room: ShortRoomId, ) -> impl Stream<Item = (Vec<u8>, SendingEvent)> + Send + '_ + use<'_>
Streams the queued PDU rows of one room for a destination.
An EDU row whose count equals the room’s short id has exactly the room’s key prefix and is skipped.
Source§impl Data
impl Data
Sourcepub(super) fn queued_except<'a>(
&'a self,
destination: &'a Destination,
skip: &'a [ShortRoomId],
) -> impl Stream<Item = (Vec<u8>, SendingEvent)> + Send + 'a
pub(super) fn queued_except<'a>( &'a self, destination: &'a Destination, skip: &'a [ShortRoomId], ) -> impl Stream<Item = (Vec<u8>, SendingEvent)> + Send + 'a
Streams the queued rows of one destination, past the PDU rows of skip.
skip must be sorted. Each skipped room costs one seek rather than a visit
per row, and the EDU row sharing a skipped room’s key bytes is still yielded.
Source§impl Data
impl Data
fn queued_range( &self, start: &[u8], end: Bound<Vec<u8>>, ) -> impl Stream<Item = (Vec<u8>, SendingEvent)> + Send + '_ + use<'_>
Source§impl Data
impl Data
Source§impl Data
impl Data
Sourcepub(super) async fn next_park(
&self,
server: &ServerName,
room: ShortRoomId,
) -> Park
pub(super) async fn next_park( &self, server: &ServerName, room: ShortRoomId, ) -> Park
Computes the park for a room that failed again.
Each consecutive park doubles the last hold, up to a day; the caller writes it.
Source§impl Data
impl Data
Sourcepub(super) fn queued_badge_refresh_destinations(
&self,
) -> impl Stream<Item = Destination> + Send + '_
pub(super) fn queued_badge_refresh_destinations( &self, ) -> impl Stream<Item = Destination> + Send + '_
Streams queued push destinations with a pending badge refresh.
Returned destinations are owned and may safely cross cursor advances.
Source§impl Data
impl Data
Sourcepub(super) fn queued_federation_destinations<'a, F>(
&'a self,
owns: F,
) -> impl Stream<Item = Result<Destination>> + Send + 'a
pub(super) fn queued_federation_destinations<'a, F>( &'a self, owns: F, ) -> impl Stream<Item = Result<Destination>> + Send + 'a
Streams distinct queued federation destinations belonging to this worker.
Each seek copies one key into the owned cursor and skips its complete destination prefix. Sigils and other shards are skipped before ownership.
Auto Trait Implementations§
impl !RefUnwindSafe for Data
impl !UnwindSafe for Data
impl Freeze for Data
impl Send for Data
impl Sync for Data
impl Unpin for Data
impl UnsafeUnpin for Data
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ExpectInto for T
impl<T> ExpectInto for T
Source§impl<T> Expected for T
impl<T> Expected for T
Source§fn expected_add(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedAdd,
fn expected_add(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedAdd,
rhs with an expectation that the operation is valid. Read moreSource§fn expected_sub(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedSub,
fn expected_sub(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedSub,
rhs with an expectation that the operation is valid. Read moreSource§fn expected_mul(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedMul,
fn expected_mul(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedMul,
rhs with an expectation that the operation is valid. Read moreSource§fn expected_div(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedDiv,
fn expected_div(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedDiv,
rhs with an expectation that the operation is valid. Read moreSource§fn expected_rem(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedRem,
fn expected_rem(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedRem,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> JsonCastable<CanonicalJsonValue> for T
impl<T> JsonCastable<Value> for T
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
§fn compression(self) -> Compression<Self>where
Self: Sized,
fn compression(self) -> Compression<Self>where
Self: Sized,
§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
§fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
§fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
§fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
§fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
§fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
§fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
§fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
§fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
§fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
§fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
500 Internal Server responses. Read moreSource§impl<T> Tried for T
impl<T> Tried for T
Source§fn try_add(self, rhs: Self) -> Result<Self, Error>where
Self: Sized + CheckedAdd,
fn try_add(self, rhs: Self) -> Result<Self, Error>where
Self: Sized + CheckedAdd,
rhs with checked arithmetic. Read moreSource§fn try_sub(self, rhs: Self) -> Result<Self, Error>where
Self: Sized + CheckedSub,
fn try_sub(self, rhs: Self) -> Result<Self, Error>where
Self: Sized + CheckedSub,
rhs with checked arithmetic. Read moreSource§fn try_mul(self, rhs: Self) -> Result<Self, Error>where
Self: Sized + CheckedMul,
fn try_mul(self, rhs: Self) -> Result<Self, Error>where
Self: Sized + CheckedMul,
rhs with checked arithmetic. Read more