qdrant_edge/edge/builders/
retrieve_request.rs1use crate::segment::types::{ExtendedPointId, WithPayloadInterface, WithVector};
7
8use crate::edge::requests::retrieve::RetrieveRequest;
9
10#[derive(Clone, Debug)]
15pub struct RetrieveRequestBuilder {
16 point_ids: Vec<ExtendedPointId>,
17 with_payload: Option<WithPayloadInterface>,
18 with_vector: Option<WithVector>,
19}
20
21impl RetrieveRequestBuilder {
22 pub fn new(point_ids: Vec<ExtendedPointId>) -> Self {
23 let RetrieveRequest {
24 point_ids,
25 with_payload,
26 with_vector,
27 } = RetrieveRequest::new(point_ids);
28 Self {
29 point_ids,
30 with_payload,
31 with_vector,
32 }
33 }
34
35 pub fn with_payload(mut self, with_payload: WithPayloadInterface) -> Self {
36 self.with_payload = Some(with_payload);
37 self
38 }
39
40 pub fn with_vector(mut self, with_vector: WithVector) -> Self {
41 self.with_vector = Some(with_vector);
42 self
43 }
44
45 pub fn build(self) -> RetrieveRequest {
46 let Self {
49 point_ids,
50 with_payload,
51 with_vector,
52 } = self;
53 RetrieveRequest {
54 point_ids,
55 with_payload,
56 with_vector,
57 }
58 }
59}