pub struct ActivityManager { /* private fields */ }Expand description
Manager for team activity tracking
Implementations§
Source§impl ActivityManager
impl ActivityManager
Sourcepub async fn record_event(&self, event: ActivityEvent)
pub async fn record_event(&self, event: ActivityEvent)
Record an activity event
Sourcepub async fn get_activities(
&self,
team_id: TeamId,
limit: usize,
offset: usize,
) -> Vec<ActivityEvent>
pub async fn get_activities( &self, team_id: TeamId, limit: usize, offset: usize, ) -> Vec<ActivityEvent>
Get recent activities for a team
Sourcepub async fn get_activities_by_type(
&self,
team_id: TeamId,
event_type: EventType,
limit: usize,
) -> Vec<ActivityEvent>
pub async fn get_activities_by_type( &self, team_id: TeamId, event_type: EventType, limit: usize, ) -> Vec<ActivityEvent>
Get activities by type
Sourcepub async fn get_activities_by_actor(
&self,
team_id: TeamId,
actor_id: MemberId,
limit: usize,
) -> Vec<ActivityEvent>
pub async fn get_activities_by_actor( &self, team_id: TeamId, actor_id: MemberId, limit: usize, ) -> Vec<ActivityEvent>
Get activities by actor
Sourcepub async fn get_activities_in_range(
&self,
team_id: TeamId,
start: DateTime<Utc>,
end: DateTime<Utc>,
) -> Vec<ActivityEvent>
pub async fn get_activities_in_range( &self, team_id: TeamId, start: DateTime<Utc>, end: DateTime<Utc>, ) -> Vec<ActivityEvent>
Get activities in a time range
Sourcepub fn subscribe(&self) -> Receiver<ActivityEvent>
pub fn subscribe(&self) -> Receiver<ActivityEvent>
Subscribe to activity events
Sourcepub async fn create_notification(&self, notification: Notification)
pub async fn create_notification(&self, notification: Notification)
Create a notification for a user
Sourcepub async fn get_unread_notifications(
&self,
user_id: MemberId,
) -> Vec<Notification>
pub async fn get_unread_notifications( &self, user_id: MemberId, ) -> Vec<Notification>
Get unread notifications for a user
Sourcepub async fn get_notifications(
&self,
user_id: MemberId,
limit: usize,
offset: usize,
) -> Vec<Notification>
pub async fn get_notifications( &self, user_id: MemberId, limit: usize, offset: usize, ) -> Vec<Notification>
Get all notifications for a user
Sourcepub async fn mark_as_read(&self, user_id: MemberId, notification_id: Uuid)
pub async fn mark_as_read(&self, user_id: MemberId, notification_id: Uuid)
Mark notification as read
Sourcepub async fn mark_all_as_read(&self, user_id: MemberId)
pub async fn mark_all_as_read(&self, user_id: MemberId)
Mark all notifications as read for a user
Sourcepub async fn delete_notification(
&self,
user_id: MemberId,
notification_id: Uuid,
)
pub async fn delete_notification( &self, user_id: MemberId, notification_id: Uuid, )
Delete a notification
Sourcepub async fn update_preferences(&self, preferences: NotificationPreferences)
pub async fn update_preferences(&self, preferences: NotificationPreferences)
Update notification preferences
Sourcepub async fn get_preferences(
&self,
user_id: MemberId,
) -> NotificationPreferences
pub async fn get_preferences( &self, user_id: MemberId, ) -> NotificationPreferences
Get notification preferences for a user
Sourcepub async fn get_unread_count(&self, user_id: MemberId) -> usize
pub async fn get_unread_count(&self, user_id: MemberId) -> usize
Get unread notification count for a user
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ActivityManager
impl !RefUnwindSafe for ActivityManager
impl Send for ActivityManager
impl Sync for ActivityManager
impl Unpin for ActivityManager
impl UnsafeUnpin for ActivityManager
impl !UnwindSafe for ActivityManager
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more