pub struct Appservice {
pub homeserver_token: String,
pub appservice_token: String,
pub client: MatrixClient,
/* private fields */
}Fields§
§homeserver_token: String§appservice_token: String§client: MatrixClientImplementations§
Source§impl Appservice
impl Appservice
pub fn new( homeserver_token: impl Into<String>, appservice_token: impl Into<String>, client: MatrixClient, ) -> Self
pub fn with_appservice_id(self, appservice_id: impl Into<String>) -> Self
pub fn with_homeserver_name(self, homeserver_name: impl Into<String>) -> Self
pub fn with_user_prefix(self, user_prefix: impl Into<String>) -> Self
pub fn with_alias_prefix(self, alias_prefix: impl Into<String>) -> Self
pub fn with_user_namespace_regexes<I, S>(self, regexes: I) -> Self
pub fn with_alias_namespace_regexes<I, S>(self, regexes: I) -> Self
pub fn with_protocols<I, S>(self, protocols: I) -> Self
pub fn with_handler(self, handler: Arc<dyn AppserviceHandler>) -> Self
pub fn get_intent(&self, localpart: &str) -> Intent
pub fn get_user_id(&self, localpart: &str) -> String
pub fn get_intent_for_suffix(&self, suffix: &str) -> Result<Intent>
pub fn get_user_id_for_suffix(&self, suffix: &str) -> Result<String>
pub fn get_intent_for_user_id(&self, user_id: &str) -> Intent
pub fn get_suffix_for_user_id(&self, user_id: &str) -> Result<Option<String>>
pub fn is_namespaced_user(&self, user_id: &str) -> bool
pub fn get_alias(&self, localpart: &str) -> String
pub fn get_alias_for_suffix(&self, suffix: &str) -> Result<String>
pub fn get_alias_localpart_for_suffix(&self, suffix: &str) -> Result<String>
pub fn get_suffix_for_alias(&self, alias: &str) -> Result<Option<String>>
pub fn is_namespaced_alias(&self, alias: &str) -> bool
pub async fn add_preprocessor(&self, preprocessor: Arc<dyn IPreprocessor>)
pub async fn set_room_directory_visibility( &self, network_id: &str, room_id: &str, visibility: &str, ) -> Result<Value>
pub fn router(&self) -> Router
Sourcepub async fn begin(&self) -> Result<()>
pub async fn begin(&self) -> Result<()>
Present for API parity with the TypeScript SDK where the appservice starts
its own web server. In Rust, server startup is controlled by the host
application using router().
pub async fn expect_ping_transaction(&self, transaction_id: impl Into<String>)
pub async fn expected_ping_transaction(&self) -> Option<String>
pub async fn ping_homeserver(&self) -> Result<PingHomeserverResponse>
Trait Implementations§
Source§impl Clone for Appservice
impl Clone for Appservice
Source§fn clone(&self) -> Appservice
fn clone(&self) -> Appservice
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for Appservice
impl Default for Appservice
Source§impl UnstableAppserviceApis for Appservice
impl UnstableAppserviceApis for Appservice
fn unstable_ping<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn send_historical_event_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
room_id: &'life1 str,
prev_event_id: &'life2 str,
events: Vec<Value>,
state_events_at_start: Vec<Value>,
chunk_id: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<MSC2716BatchSendResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn send_historical_event_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
room_id: &'life1 str,
prev_event_id: &'life2 str,
events: Vec<Value>,
state_events_at_start: Vec<Value>,
chunk_id: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<MSC2716BatchSendResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Send several historical events into a room (MSC2716).
Source§fn send_event_with_timestamp<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
room_id: &'life1 str,
event_type: &'life2 str,
content: &'life3 Value,
ts: u64,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn send_event_with_timestamp<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
room_id: &'life1 str,
event_type: &'life2 str,
content: &'life3 Value,
ts: u64,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Sends an event to the given room with a given timestamp.
Source§fn send_state_event_with_timestamp<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
room_id: &'life1 str,
event_type: &'life2 str,
state_key: &'life3 str,
content: &'life4 Value,
ts: u64,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn send_state_event_with_timestamp<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
room_id: &'life1 str,
event_type: &'life2 str,
state_key: &'life3 str,
content: &'life4 Value,
ts: u64,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Sends a state event to the given room with a given timestamp.
Auto Trait Implementations§
impl Freeze for Appservice
impl !RefUnwindSafe for Appservice
impl Send for Appservice
impl Sync for Appservice
impl Unpin for Appservice
impl UnsafeUnpin for Appservice
impl !UnwindSafe for Appservice
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
Mutably borrows from an owned value. Read more