Skip to main content

UserProfileBehavior

Trait UserProfileBehavior 

Source
pub trait UserProfileBehavior {
Show 22 methods // Required methods fn get_user_information( &self, user_id: &str, ) -> impl Future<Output = Result<GetUserInformationDTO, Error>> + Send; fn update_user_profile( &self, user_id: &str, bio: Option<&str>, ) -> impl Future<Output = Result<GetUserInformationDTO, Error>> + Send; fn get_user_email( &self, user_id: &str, ) -> impl Future<Output = Result<GetUserEmailDTO, Error>> + Send; fn get_user_following( &self, user_id: &str, limit: Option<u32>, cursor: Option<&str>, ) -> impl Future<Output = Result<CursorListDTO<GetUserInformationDTO>, Error>> + Send; fn get_user_followers( &self, user_id: &str, limit: Option<u32>, cursor: Option<&str>, ) -> impl Future<Output = Result<CursorListDTO<GetUserInformationDTO>, Error>> + Send; fn get_user_topics( &self, user_id: &str, limit: Option<u32>, ) -> impl Future<Output = Result<UserSubjectsDTO, Error>> + Send; fn get_user_posts( &self, user_id: &str, role: Option<&str>, limit: Option<u32>, ) -> impl Future<Output = Result<UserRepliesDTO, Error>> + Send; fn get_user_featured_topics( &self, user_id: &str, ) -> impl Future<Output = Result<UserFeaturedTopicsDTO, Error>> + Send; fn get_user_topic_collections( &self, user_id: &str, limit: Option<u32>, ) -> impl Future<Output = Result<CursorListDTO<Value>, Error>> + Send; fn get_user_badges( &self, user_id: &str, ) -> impl Future<Output = Result<UserBadgesDTO, Error>> + Send; fn get_user_badge_display( &self, user_id: &str, ) -> impl Future<Output = Result<BadgeDisplayDTO, Error>> + Send; fn get_user_badge_displays( &self, user_ids: &[String], ) -> impl Future<Output = Result<UserBadgeDisplaysDTO, Error>> + Send; fn get_user_profile_activities( &self, user_id: &str, year: Option<u32>, limit: Option<u32>, ) -> impl Future<Output = Result<CursorListDTO<ProfileActivityDTO>, Error>> + Send; fn get_my_profile_activities( &self, year: Option<u32>, limit: Option<u32>, ) -> impl Future<Output = Result<CursorListDTO<ProfileActivityDTO>, Error>> + Send; fn get_user_level_contributions( &self, user_id: &str, year: u32, ) -> impl Future<Output = Result<LevelContributionsDTO, Error>> + Send; fn get_my_level_contributions( &self, year: u32, ) -> impl Future<Output = Result<LevelContributionsDTO, Error>> + Send; fn get_level_progress( &self, ) -> impl Future<Output = Result<LevelProgressDTO, Error>> + Send; fn get_content_length_limit( &self, ) -> impl Future<Output = Result<ContentLengthLimitDTO, Error>> + Send; fn get_topic_collection_usage( &self, ) -> impl Future<Output = Result<TopicCollectionUsageDTO, Error>> + Send; fn get_file_storage( &self, ) -> impl Future<Output = Result<FileStorageDTO, Error>> + Send; fn get_bookmarks( &self, limit: Option<u32>, ) -> impl Future<Output = Result<CursorListDTO<Value>, Error>> + Send; fn get_avatar_presets( &self, ) -> impl Future<Output = Result<AvatarPresetsDTO, Error>> + Send;
}
Expand description

User-chapter endpoints from the docs (https://pickcat-docs.xiaole6324.fun/user.html): profile, content, badges, activities, level and account quotas.

Registration / email verification and the exam flow live in crate::auth.

Required Methods§

Source

fn get_user_information( &self, user_id: &str, ) -> impl Future<Output = Result<GetUserInformationDTO, Error>> + Send

GET /api/v1/users/{userId} — public, works with or without a session.

Source

fn update_user_profile( &self, user_id: &str, bio: Option<&str>, ) -> impl Future<Output = Result<GetUserInformationDTO, Error>> + Send

PATCH /api/v1/users/{userId} — requires a session; only the current user may edit their own profile. None fields are left unchanged.

Source

fn get_user_email( &self, user_id: &str, ) -> impl Future<Output = Result<GetUserEmailDTO, Error>> + Send

GET /api/v1/users/{userId}/email — requires a session and only works for the current user.

Source

fn get_user_following( &self, user_id: &str, limit: Option<u32>, cursor: Option<&str>, ) -> impl Future<Output = Result<CursorListDTO<GetUserInformationDTO>, Error>> + Send

GET /api/v1/users/{userId}/following — public, cursor-paginated.

Source

fn get_user_followers( &self, user_id: &str, limit: Option<u32>, cursor: Option<&str>, ) -> impl Future<Output = Result<CursorListDTO<GetUserInformationDTO>, Error>> + Send

GET /api/v1/users/{userId}/followers — public, cursor-paginated.

Source

fn get_user_topics( &self, user_id: &str, limit: Option<u32>, ) -> impl Future<Output = Result<UserSubjectsDTO, Error>> + Send

GET /api/v1/users/{userId}/topics — public, cursor-paginated.

Source

fn get_user_posts( &self, user_id: &str, role: Option<&str>, limit: Option<u32>, ) -> impl Future<Output = Result<UserRepliesDTO, Error>> + Send

GET /api/v1/users/{userId}/posts?role=reply — public, cursor-paginated.

GET /api/v1/users/{userId}/featured-topics — public, no pagination.

Source

fn get_user_topic_collections( &self, user_id: &str, limit: Option<u32>, ) -> impl Future<Output = Result<CursorListDTO<Value>, Error>> + Send

GET /api/v1/users/{userId}/topic-collections — public, paginated.

Item shape is not documented yet, so items are kept as raw JSON.

Source

fn get_user_badges( &self, user_id: &str, ) -> impl Future<Output = Result<UserBadgesDTO, Error>> + Send

GET /api/v1/users/{userId}/badges — public.

Source

fn get_user_badge_display( &self, user_id: &str, ) -> impl Future<Output = Result<BadgeDisplayDTO, Error>> + Send

GET /api/v1/users/{userId}/badge-display — public.

Source

fn get_user_badge_displays( &self, user_ids: &[String], ) -> impl Future<Output = Result<UserBadgeDisplaysDTO, Error>> + Send

GET /api/v1/user-badge-displays?userIds=a,b — public bulk lookup.

Source

fn get_user_profile_activities( &self, user_id: &str, year: Option<u32>, limit: Option<u32>, ) -> impl Future<Output = Result<CursorListDTO<ProfileActivityDTO>, Error>> + Send

GET /api/v1/users/{userId}/profile-activities — public, paginated.

Source

fn get_my_profile_activities( &self, year: Option<u32>, limit: Option<u32>, ) -> impl Future<Output = Result<CursorListDTO<ProfileActivityDTO>, Error>> + Send

GET /api/v1/profile-activities — requires a session.

Source

fn get_user_level_contributions( &self, user_id: &str, year: u32, ) -> impl Future<Output = Result<LevelContributionsDTO, Error>> + Send

GET /api/v1/users/{userId}/level-contributions/{year} — public.

Source

fn get_my_level_contributions( &self, year: u32, ) -> impl Future<Output = Result<LevelContributionsDTO, Error>> + Send

GET /api/v1/level-contributions/{year} — requires a session.

Source

fn get_level_progress( &self, ) -> impl Future<Output = Result<LevelProgressDTO, Error>> + Send

GET /api/v1/level-progress — requires a session.

Source

fn get_content_length_limit( &self, ) -> impl Future<Output = Result<ContentLengthLimitDTO, Error>> + Send

GET /api/v1/content-length-limit — requires a session.

Source

fn get_topic_collection_usage( &self, ) -> impl Future<Output = Result<TopicCollectionUsageDTO, Error>> + Send

GET /api/v1/topic-collection-usage — requires a session.

Source

fn get_file_storage( &self, ) -> impl Future<Output = Result<FileStorageDTO, Error>> + Send

GET /api/v1/file-storage — requires a session.

Source

fn get_bookmarks( &self, limit: Option<u32>, ) -> impl Future<Output = Result<CursorListDTO<Value>, Error>> + Send

GET /api/v1/bookmarks — requires a session, paginated.

Item shape is not documented yet, so items are kept as raw JSON.

Source

fn get_avatar_presets( &self, ) -> impl Future<Output = Result<AvatarPresetsDTO, Error>> + Send

GET /api/v1/avatar-presets — public.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§