pub trait ReadingSessionBehavior {
// Required method
fn report_reading_batch(
&self,
session_id: &str,
batch_no: u32,
topic_id: &str,
elapsed_ms: u64,
visible_posts: Vec<VisiblePostDTO>,
) -> impl Future<Output = Result<ReadingBatchResponseDTO, Error>> + Send;
}Expand description
阅读埋点,来自文档的「阅读会话」章节 (https://pickcat-docs.xiaole6324.fun/reading-session.html)。
Required Methods§
Sourcefn report_reading_batch(
&self,
session_id: &str,
batch_no: u32,
topic_id: &str,
elapsed_ms: u64,
visible_posts: Vec<VisiblePostDTO>,
) -> impl Future<Output = Result<ReadingBatchResponseDTO, Error>> + Send
fn report_reading_batch( &self, session_id: &str, batch_no: u32, topic_id: &str, elapsed_ms: u64, visible_posts: Vec<VisiblePostDTO>, ) -> impl Future<Output = Result<ReadingBatchResponseDTO, Error>> + Send
PUT /api/v1/reading-sessions/{sessionId}/batches/{batchNo} —— 需要会话。
session_id 由调用方生成;batch_no 为批次序号。成功返回 201。
visible_posts 至少要有 1 项,否则服务端返回 400 VALIDATION_FAILED。
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".