Struct raiden_rs::raiden_network_transport::matrix::MatrixClient
source · pub struct MatrixClient { /* private fields */ }Expand description
Matrix client type.
Implementations§
source§impl MatrixClient
impl MatrixClient
sourcepub async fn new(
homeserver_url: String,
private_key: PrivateKey
) -> MatrixClient
pub async fn new( homeserver_url: String, private_key: PrivateKey ) -> MatrixClient
Create a new instance of MatrixClient.
sourcepub fn set_sync_token(&mut self, sync_token: String)
pub fn set_sync_token(&mut self, sync_token: String)
Set sync token based on the last sync.
sourcepub fn get_sync_token(&self) -> String
pub fn get_sync_token(&self) -> String
Return the last known sync token.
sourcepub fn private_key(&self) -> PrivateKey
pub fn private_key(&self) -> PrivateKey
Return a copy of the private key.
sourcepub async fn init(&self) -> Result<(), TransportError>
pub async fn init(&self) -> Result<(), TransportError>
Initialize the client by logging into the matrix home server.
sourcepub async fn populate_services_addresses(
&mut self,
service_registry_proxy: ServiceRegistryProxy<Http>
)
pub async fn populate_services_addresses( &mut self, service_registry_proxy: ServiceRegistryProxy<Http> )
Populate services addresses based on on-chain updates to the service registry.
sourcepub async fn get_new_messages(&mut self) -> Result<Vec<IncomingMessage>, Error>
pub async fn get_new_messages(&mut self) -> Result<Vec<IncomingMessage>, Error>
Sync and retrieve any new messages received on the home server.
sourcepub fn address_metadata(&self) -> AddressMetadata
pub fn address_metadata(&self) -> AddressMetadata
Construct the address metadata of the current account.
sourcepub fn make_user_id(&self, address: &H160) -> String
pub fn make_user_id(&self, address: &H160) -> String
Return’s the matrix user ID.
sourcepub async fn send(
&self,
message: OutgoingMessage,
receiver_metadata: AddressMetadata
) -> Result<(), TransportError>
pub async fn send( &self, message: OutgoingMessage, receiver_metadata: AddressMetadata ) -> Result<(), TransportError>
Send message to the matrix home server.
sourcepub async fn broadcast(
&self,
data: String,
device_id: DeviceIdOrAllDevices
) -> Result<(), TransportError>
pub async fn broadcast( &self, data: String, device_id: DeviceIdOrAllDevices ) -> Result<(), TransportError>
Broadcast message to all known service addresses.
Auto Trait Implementations§
impl Freeze for MatrixClient
impl !RefUnwindSafe for MatrixClient
impl Send for MatrixClient
impl Sync for MatrixClient
impl Unpin for MatrixClient
impl !UnwindSafe for MatrixClient
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
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> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.