Skip to main content

rivetkit_actor_persist/
lib.rs

1pub mod generated;
2pub mod versioned;
3
4// Re-export latest.
5pub use generated::v4::*;
6
7pub const CURRENT_VERSION: u16 = 4;
8
9impl Default for generated::v4::Actor {
10	fn default() -> Self {
11		Self {
12			input: None,
13			has_initialized: false,
14			state: Vec::new(),
15			scheduled_events: Vec::new(),
16		}
17	}
18}
19
20impl Default for generated::v4::ScheduleEvent {
21	fn default() -> Self {
22		Self {
23			event_id: String::new(),
24			timestamp: 0,
25			action: String::new(),
26			args: None,
27		}
28	}
29}
30
31impl Default for generated::v4::Subscription {
32	fn default() -> Self {
33		Self {
34			event_name: String::new(),
35		}
36	}
37}
38
39impl Default for generated::v4::Conn {
40	fn default() -> Self {
41		Self {
42			id: String::new(),
43			parameters: Vec::new(),
44			state: Vec::new(),
45			subscriptions: Vec::new(),
46			gateway_id: [0; 4],
47			request_id: [0; 4],
48			server_message_index: 0,
49			client_message_index: 0,
50			request_path: String::new(),
51			request_headers: std::collections::HashMap::new(),
52		}
53	}
54}
55
56impl Default for generated::v4::QueueMetadata {
57	fn default() -> Self {
58		Self {
59			next_id: 0,
60			size: 0,
61		}
62	}
63}
64
65impl Default for generated::v4::QueueMessage {
66	fn default() -> Self {
67		Self {
68			name: String::new(),
69			body: Vec::new(),
70			created_at: 0,
71			failure_count: None,
72			available_at: None,
73			in_flight: None,
74			in_flight_at: None,
75		}
76	}
77}