harmos_domain/operations/storage/
follow_objects.rs1use super::STREAM_POLICY;
22use crate::MemorySize;
23use crate::model::storage::codec::{Nested, Optional, product};
24use crate::model::storage::{ObjectEntry, ObjectSelection, StorageCursor};
25use crate::operations::Visibility;
26
27product!(FollowObjects {
32 after: Optional<Nested<StorageCursor>> => 1,
33 selection: Nested<ObjectSelection> => 2,
34});
35
36crate::declare!(FollowObjects {
37 id: "storage.follow_objects",
38 version: 1,
39 policy: STREAM_POLICY,
40 response: StorageCursor,
41 output: ObjectEntry,
42 visibility: Visibility::Host,
43});
44
45#[derive(Clone, Debug, PartialEq, Eq)]
50pub struct FollowObjects {
51 pub after: Option<StorageCursor>,
52 pub selection: ObjectSelection,
53}
54
55impl MemorySize for FollowObjects {
62 fn memory_size(&self) -> usize {
63 std::mem::size_of::<Self>()
64 .saturating_add(self.after.memory_size().saturating_sub(std::mem::size_of_val(&self.after)))
65 .saturating_add(self.selection.memory_size().saturating_sub(std::mem::size_of_val(&self.selection)))
66 }
67}
68
69