qdrant_edge/shard/
scroll.rs1use schemars::JsonSchema;
2use crate::segment::data_types::order_by::OrderByInterface;
3use crate::segment::types::{Filter, PointIdType, WithPayloadInterface, WithVector};
4use serde::{Deserialize, Serialize};
5use validator::Validate;
6
7#[derive(Clone, Debug, PartialEq, Hash, Deserialize, Serialize, JsonSchema, Validate)]
9#[serde(rename_all = "snake_case")]
10pub struct ScrollRequestInternal {
11 pub offset: Option<PointIdType>,
13
14 #[validate(range(min = 1))]
16 pub limit: Option<usize>,
17
18 #[validate(nested)]
20 pub filter: Option<Filter>,
21
22 pub with_payload: Option<WithPayloadInterface>,
24
25 #[serde(default, alias = "with_vectors")]
27 pub with_vector: WithVector,
28
29 pub order_by: Option<OrderByInterface>,
31}
32
33impl Default for ScrollRequestInternal {
34 fn default() -> Self {
35 ScrollRequestInternal {
36 offset: None,
37 limit: Some(Self::default_limit()),
38 filter: None,
39 with_payload: Some(Self::default_with_payload()),
40 with_vector: Self::default_with_vector(),
41 order_by: None,
42 }
43 }
44}
45
46impl ScrollRequestInternal {
47 pub const fn default_limit() -> usize {
48 10
49 }
50
51 pub const fn default_with_payload() -> WithPayloadInterface {
52 WithPayloadInterface::Bool(true)
53 }
54
55 pub const fn default_with_vector() -> WithVector {
56 WithVector::Bool(false)
57 }
58}