Skip to main content

SynchronousMatrixClient

Struct SynchronousMatrixClient 

Source
pub struct SynchronousMatrixClient { /* private fields */ }

Implementations§

Source§

impl SynchronousMatrixClient

Source

pub fn new(inner: MatrixClient) -> Result<Self>

Source

pub fn sync_once(&self, since: Option<&str>) -> Result<Vec<RoomEvent>>

Source

pub fn start_sync(&self, handler: Arc<dyn SyncEventHandler>) -> Result<()>

Source

pub fn send_message(&self, room_id: &str, body: &str) -> Result<String>

Source

pub fn send_text(&self, room_id: &str, body: &str) -> Result<String>

Source

pub fn send_notice(&self, room_id: &str, body: &str) -> Result<String>

Source

pub fn send_event( &self, room_id: &str, event_type: &str, content: &Value, ) -> Result<String>

Source

pub fn send_state_event( &self, room_id: &str, event_type: &str, state_key: &str, content: &Value, ) -> Result<String>

Source

pub fn redact_event( &self, room_id: &str, event_id: &str, reason: Option<&str>, ) -> Result<String>

Source

pub fn join_room(&self, room_id_or_alias: &str) -> Result<String>

Source

pub fn leave_room(&self, room_id: &str, reason: Option<&str>) -> Result<()>

Source

pub fn invite_user(&self, user_id: &str, room_id: &str) -> Result<()>

Source

pub fn kick_user( &self, user_id: &str, room_id: &str, reason: Option<&str>, ) -> Result<()>

Source

pub fn ban_user( &self, user_id: &str, room_id: &str, reason: Option<&str>, ) -> Result<()>

Source

pub fn unban_user(&self, user_id: &str, room_id: &str) -> Result<()>

Source

pub fn get_joined_rooms(&self) -> Result<Vec<String>>

Source

pub fn get_joined_room_members(&self, room_id: &str) -> Result<Vec<String>>

Source

pub fn get_room_state(&self, room_id: &str) -> Result<Vec<Value>>

Source

pub fn get_room_state_event( &self, room_id: &str, event_type: &str, state_key: &str, ) -> Result<Value>

Source

pub fn get_user_id(&self) -> Result<String>

Source

pub fn profile(&self, user_id: &str) -> Result<MatrixProfile>

Source

pub fn set_display_name(&self, display_name: &str) -> Result<()>

Source

pub fn set_avatar_url(&self, avatar_url: &str) -> Result<()>

Source

pub fn get_presence_status(&self, user_id: &str) -> Result<Presence>

Source

pub fn set_presence_status( &self, status: Presence, status_msg: Option<&str>, ) -> Result<()>

Source

pub fn create_room(&self, options: &CreateRoom) -> Result<String>

Source

pub fn create_room_alias(&self, alias: &str, room_id: &str) -> Result<()>

Source

pub fn delete_room_alias(&self, alias: &str) -> Result<()>

Source

pub fn lookup_room_alias( &self, alias: &str, ) -> Result<RoomDirectoryLookupResponse>

Source

pub fn set_account_data(&self, event_type: &str, content: &Value) -> Result<()>

Source

pub fn get_account_data(&self, event_type: &str) -> Result<Value>

Source

pub fn upload_media( &self, bytes: Vec<u8>, content_type: &str, filename: Option<&str>, ) -> Result<MXCUrl>

Source

pub fn download_media(&self, mxc: &MXCUrl) -> Result<Vec<u8>>

Source

pub fn mxc_to_http( &self, mxc: &str, width: Option<u32>, height: Option<u32>, ) -> Option<String>

Source

pub fn get_event(&self, room_id: &str, event_id: &str) -> Result<Value>

Source

pub fn get_server_versions(&self) -> Result<Value>

Source

pub fn get_capabilities(&self) -> Result<Value>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more