pub struct MatrixClient { /* private fields */ }Expand description
Matrix client wrapper
Provides a simplified API for common Matrix operations.
Implementations§
Source§impl MatrixClient
impl MatrixClient
Sourcepub async fn send_message(
&self,
room: &Room,
content: &str,
) -> Result<OwnedEventId, BotError>
pub async fn send_message( &self, room: &Room, content: &str, ) -> Result<OwnedEventId, BotError>
Send a plain text message to a room
Sourcepub async fn send_formatted_message(
&self,
room: &Room,
plain: &str,
html: &str,
) -> Result<OwnedEventId, BotError>
pub async fn send_formatted_message( &self, room: &Room, plain: &str, html: &str, ) -> Result<OwnedEventId, BotError>
Send a formatted (HTML) message to a room
Sourcepub async fn send_typing(
&self,
room: &Room,
typing: bool,
) -> Result<(), BotError>
pub async fn send_typing( &self, room: &Room, typing: bool, ) -> Result<(), BotError>
Send a typing notification
Sourcepub async fn send_file(
&self,
room: &Room,
filename: &str,
bytes: Vec<u8>,
) -> Result<OwnedEventId, BotError>
pub async fn send_file( &self, room: &Room, filename: &str, bytes: Vec<u8>, ) -> Result<OwnedEventId, BotError>
Upload a file and send it to a room
The MIME type is guessed from the filename; Matrix requires one, and
application/octet-stream is the safe fallback.
Sourcepub async fn react(
&self,
room: &Room,
event_id: &OwnedEventId,
emoji: &str,
) -> Result<OwnedEventId, BotError>
pub async fn react( &self, room: &Room, event_id: &OwnedEventId, emoji: &str, ) -> Result<OwnedEventId, BotError>
React to a message with an emoji
Trait Implementations§
Source§impl Clone for MatrixClient
impl Clone for MatrixClient
Source§fn clone(&self) -> MatrixClient
fn clone(&self) -> MatrixClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for MatrixClient
impl !UnwindSafe for MatrixClient
impl Freeze for MatrixClient
impl Send for MatrixClient
impl Sync for MatrixClient
impl Unpin for MatrixClient
impl UnsafeUnpin for MatrixClient
Blanket Implementations§
impl<T> Any for Twhere
T: Any,
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ChatActionSenderBounds for T
impl<T> CloneAny for T
impl<T> CloneAnySend for T
impl<T> CloneAnySendSync for T
impl<T> CloneAnySync for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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