pub(crate) struct Context<'a> {
pub(crate) services: &'a Services,
pub(crate) body: &'a [&'a str],
pub(crate) timer: SystemTime,
pub(crate) reply_id: Option<&'a EventId>,
pub(crate) output: Mutex<BufWriter<Vec<u8>>>,
}Fields§
§services: &'a Services§body: &'a [&'a str]§timer: SystemTime§reply_id: Option<&'a EventId>§output: Mutex<BufWriter<Vec<u8>>>Implementations§
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn appservice_unregister( &self, appservice_identifier: String, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn appservice_show_config( &self, appservice_identifier: String, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn get_auth_chain(&self, event_id: OwnedEventId) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn get_short_pdu( &self, shortroomid: ShortRoomId, count: i64, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn get_remote_pdu_list( &self, server: OwnedServerName, force: bool, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn get_remote_pdu( &self, event_id: OwnedEventId, server: OwnedServerName, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn verify_pdu(&self, event_id: OwnedEventId) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn first_pdu_in_room(&self, room_id: OwnedRoomId) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn latest_pdu_in_room(&self, room_id: OwnedRoomId) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn force_set_room_state_from_server( &self, room_id: OwnedRoomId, server_name: OwnedServerName, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn get_verify_keys( &self, server_name: Option<OwnedServerName>, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn resolve_true_destination( &self, server_name: OwnedServerName, no_cache: bool, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn memory_stats(&self, opts: Option<String>) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn get_retained_pdu(&self, event_id: OwnedEventId) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn disable_room(&self, room_id: OwnedRoomId) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn fetch_support_well_known( &self, server_name: OwnedServerName, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn remote_user_in_rooms(&self, user_id: OwnedUserId) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn delete_by_event(&self, event_id: OwnedEventId) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn delete_all_from_user(&self, username: String) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn delete_all_from_server( &self, server_name: OwnedServerName, yes_i_want_to_delete_local_media: bool, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn get_remote_file( &self, mxc: OwnedMxcUri, server: Option<OwnedServerName>, timeout: u32, ) -> Result
Source§impl Context<'_>
impl Context<'_>
async fn changes_since( &self, user_id: OwnedUserId, since: u64, room_id: Option<OwnedRoomId>, ) -> Result
Source§impl Context<'_>
impl Context<'_>
async fn account_data_get( &self, user_id: OwnedUserId, kind: String, room_id: Option<OwnedRoomId>, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn oauth_list_sessions( &self, user_id: Option<OwnedUserId>, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn oauth_show_provider( &self, id: ProviderId, config: bool, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn oauth_show_user(&self, user_id: OwnedUserId) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn oauth_revoke( &self, id: Either<SessionId, OwnedUserId>, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn remove_pusher( &self, user_id: OwnedUserId, pushkey: String, ) -> Result
Source§impl Context<'_>
impl Context<'_>
async fn destinations_cache( &self, server_name: Option<OwnedServerName>, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn short_event_id(&self, event_id: OwnedEventId) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn short_room_id(&self, room_id: OwnedRoomOrAliasId) -> Result
Source§impl Context<'_>
impl Context<'_>
async fn query_storage_duplicates( &self, provider_a: String, provider_b: String, ) -> Result
Source§impl Context<'_>
impl Context<'_>
async fn query_storage_differences( &self, provider_a: String, provider_b: String, ) -> Result
Source§impl Context<'_>
impl Context<'_>
async fn get_backup_session( &self, user_id: OwnedUserId, version: String, room_id: OwnedRoomId, session_id: String, ) -> Result
Source§impl Context<'_>
impl Context<'_>
async fn get_room_backups( &self, user_id: OwnedUserId, version: String, room_id: OwnedRoomId, ) -> Result
Source§impl Context<'_>
impl Context<'_>
async fn get_all_backups(&self, user_id: OwnedUserId, version: String) -> Result
Source§impl Context<'_>
impl Context<'_>
async fn get_backup_algorithm( &self, user_id: OwnedUserId, version: String, ) -> Result
Source§impl Context<'_>
impl Context<'_>
async fn get_latest_backup_version(&self, user_id: OwnedUserId) -> Result
Source§impl Context<'_>
impl Context<'_>
async fn get_device_metadata( &self, user_id: OwnedUserId, device_id: OwnedDeviceId, ) -> Result
Source§impl Context<'_>
impl Context<'_>
async fn count_one_time_keys( &self, user_id: OwnedUserId, device_id: OwnedDeviceId, ) -> Result
Source§impl Context<'_>
impl Context<'_>
async fn get_device_keys( &self, user_id: OwnedUserId, device_id: OwnedDeviceId, ) -> Result
Source§impl Context<'_>
impl Context<'_>
async fn get_to_device_events( &self, user_id: OwnedUserId, device_id: OwnedDeviceId, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn alias_remove(&self, room_alias_localpart: String) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn alias_which(&self, room_alias_localpart: String) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn alias_list(&self, room_id: Option<OwnedRoomId>) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn room_delete( &self, room_id: OwnedRoomId, force: bool, ) -> Result
Source§impl Context<'_>
impl Context<'_>
async fn list_joined_members( &self, room_id: OwnedRoomId, local_only: bool, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn reload_config(&self, path: Option<PathBuf>) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn admin_notice(&self, message: Vec<String>) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn deactivate( &self, no_leave_rooms: bool, user_id: String, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn delete_device( &self, user_id: OwnedUserId, device_id: OwnedDeviceId, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn deactivate_all( &self, no_leave_rooms: bool, force: bool, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn list_joined_rooms(&self, user_id: String) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn force_join_list_of_local_users( &self, room: OwnedRoomOrAliasId, yes_i_want_to_do_this: bool, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn force_join_all_local_users( &self, room: OwnedRoomOrAliasId, yes_i_want_to_do_this: bool, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn force_join_room( &self, user_id: String, room: OwnedRoomOrAliasId, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn force_leave_room( &self, user_id: String, room_id: OwnedRoomOrAliasId, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn force_demote( &self, user_id: String, room_id: OwnedRoomOrAliasId, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn force_promote( &self, target_id: String, room_id: OwnedRoomOrAliasId, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn put_room_tag( &self, user_id: String, room_id: OwnedRoomId, tag: String, ) -> Result
Source§impl Context<'_>
impl Context<'_>
pub(super) async fn delete_room_tag( &self, user_id: String, room_id: OwnedRoomId, tag: String, ) -> Result
Auto Trait Implementations§
impl<'a> !Freeze for Context<'a>
impl<'a> !RefUnwindSafe for Context<'a>
impl<'a> Send for Context<'a>
impl<'a> Sync for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> UnsafeUnpin for Context<'a>
impl<'a> !UnwindSafe for Context<'a>
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
fn expect_into<Dst>(self) -> Dst
Source§impl<T> Expected for T
impl<T> Expected for T
fn expected_add(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedAdd,
fn expected_sub(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedSub,
fn expected_mul(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedMul,
fn expected_div(self, rhs: Self) -> Selfwhere
Self: Sized + CheckedDiv,
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>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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 more§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 more