polyester/services/
profile.rs1use super::ServiceContext;
4use crate::errors::Result;
5use crate::models::AccountIdentity;
6
7#[derive(Clone)]
8pub struct ProfileService {
9 ctx: ServiceContext,
10}
11
12impl ProfileService {
13 pub fn new(ctx: ServiceContext) -> Self {
14 Self { ctx }
15 }
16
17 pub async fn subscribe_identity(
19 &self,
20 ) -> Result<crate::realtime::TypedSubscription<AccountIdentity>> {
21 self.ctx
22 .realtime
23 .subscribe_proto(
24 "public:identity:updates:proto",
25 crate::codecs::decode::account_identity_from_bytes,
26 )
27 .await
28 }
29}