pub struct MessagesService {
rpc_client: MessageServiceClient,
handle: JoinHandle<Result<()>>,
}Fields§
§rpc_client: MessageServiceClient§handle: JoinHandle<Result<()>>Implementations§
Source§impl MessagesService
impl MessagesService
pub async fn connect( connection: &Connection, ) -> Result<(Self, (MessagesStream, CatchUpStream))>
pub async fn subscribe(&self, filters: SubscriptionConfig) -> Result<()>
pub async fn update_filters( &self, request: FilterUpdateRequest, ) -> Result<SubscriptionConfig>
pub async fn catch_up( &self, request: CatchUpRequest, ) -> Result<SubscriptionConfig>
Methods from Deref<Target = MessageServiceClient>§
pub fn publish( &self, ctx: Context, message: MessageFull, ) -> impl Future<Output = Result<Result<PublishResult, MessageError>, RpcError>>
Sourcepub fn message(
&self,
ctx: Context,
id: MessageId,
) -> impl Future<Output = Result<Result<Option<MessageFull>, MessageError>, RpcError>>
pub fn message( &self, ctx: Context, id: MessageId, ) -> impl Future<Output = Result<Result<Option<MessageFull>, MessageError>, RpcError>>
Retrieve a specific message by its ID
Sourcepub fn user_data(
&self,
ctx: Context,
author: KeyId,
storage_key: StoreKey,
) -> impl Future<Output = Result<Result<Option<MessageFull>, MessageError>, RpcError>>
pub fn user_data( &self, ctx: Context, author: KeyId, storage_key: StoreKey, ) -> impl Future<Output = Result<Result<Option<MessageFull>, MessageError>, RpcError>>
Retrieve a specific user’s data by their key and storage key
Sourcepub fn check_messages(
&self,
ctx: Context,
message_ids: Vec<MessageId>,
) -> impl Future<Output = Result<Result<Vec<Option<String>>, MessageError>, RpcError>>
pub fn check_messages( &self, ctx: Context, message_ids: Vec<MessageId>, ) -> impl Future<Output = Result<Result<Vec<Option<String>>, MessageError>, RpcError>>
Check which messages the server already has and return their global stream IDs.
Returns a vec of Option<String> in the same order as the input, where:
Some(stream_id)means the server has the message with that global stream IDNonemeans the server doesn’t have this message yet
Sourcepub fn subscribe(
&self,
ctx: Context,
config: SubscriptionConfig,
) -> impl Future<Output = Result<Result<(), MessageError>, RpcError>>
pub fn subscribe( &self, ctx: Context, config: SubscriptionConfig, ) -> impl Future<Output = Result<Result<(), MessageError>, RpcError>>
Start the subscription
Sourcepub fn update_filters(
&self,
ctx: Context,
request: FilterUpdateRequest,
) -> impl Future<Output = Result<Result<SubscriptionConfig, MessageError>, RpcError>>
pub fn update_filters( &self, ctx: Context, request: FilterUpdateRequest, ) -> impl Future<Output = Result<Result<SubscriptionConfig, MessageError>, RpcError>>
Update the running subscription filters with the actions. Returns the now final subscription config.
Sourcepub fn catch_up(
&self,
ctx: Context,
request: CatchUpRequest,
) -> impl Future<Output = Result<Result<SubscriptionConfig, MessageError>, RpcError>>
pub fn catch_up( &self, ctx: Context, request: CatchUpRequest, ) -> impl Future<Output = Result<Result<SubscriptionConfig, MessageError>, RpcError>>
Update the internal subscription and catch up to the latest stream height for the given filter
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MessagesService
impl RefUnwindSafe for MessagesService
impl Send for MessagesService
impl Sync for MessagesService
impl Unpin for MessagesService
impl UnwindSafe for MessagesService
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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