pub struct IncrementalVacuumSettings {
pub largest_root_btree_page: LargestRootBtreePage,
pub incremental_vacuum_mode: IncrementalVacuumMode,
}
Expand description
Incremental vacuum settings (8 Bytes)
The two 4-byte big-endian integers at offsets 52 and 64 are used to manage the auto_vacuum and incremental_vacuum modes. If the integer at offset 52 is zero then pointer-map (ptrmap) pages are omitted from the database file and neither auto_vacuum nor incremental_vacuum are supported. If the integer at offset 52 is non-zero then it is the page number of the largest root page in the database file, the database file will contain ptrmap pages, and the mode must be either auto_vacuum or incremental_vacuum. In this latter case, the integer at offset 64 is true for incremental_vacuum and false for auto_vacuum. If the integer at offset 52 is zero then the integer at offset 64 must also be zero.
Fields§
§largest_root_btree_page: LargestRootBtreePage
§incremental_vacuum_mode: IncrementalVacuumMode
Implementations§
Source§impl IncrementalVacuumSettings
impl IncrementalVacuumSettings
Sourcepub fn largest_root_btree_page(&self) -> &LargestRootBtreePage
pub fn largest_root_btree_page(&self) -> &LargestRootBtreePage
Examples found in repository?
examples/sqlite_info.rs (line 118)
36 fn print_sqlite_info(conn: &SqliteConnection) -> AppResult<()> {
37 const LABEL_WIDTH: usize = 21;
38
39 // TODO:
40 let sqlite_header = conn.runtime().header();
41
42 let mut output = "".to_owned();
43
44 output.push_str(&format!(
45 "{label: <w$}{value}\n",
46 w = LABEL_WIDTH,
47 label = "database page size:",
48 value = u32::from(sqlite_header.page_size())
49 ));
50 output.push_str(&format!(
51 "{label: <w$}{value}\n",
52 w = LABEL_WIDTH,
53 label = "write format:",
54 value =
55 u8::from(sqlite_header.file_format_version_numbers().write_version())
56 ));
57 output.push_str(&format!(
58 "{label: <w$}{value}\n",
59 w = LABEL_WIDTH,
60 label = "read format:",
61 value =
62 u8::from(sqlite_header.file_format_version_numbers().read_version())
63 ));
64 output.push_str(&format!(
65 "{label: <w$}{value}\n",
66 w = LABEL_WIDTH,
67 label = "reserved bytes:",
68 value = **sqlite_header.reserved_bytes_per_page()
69 ));
70 output.push_str(&format!(
71 "{label: <w$}{value}\n",
72 w = LABEL_WIDTH,
73 label = "file change counter:",
74 value = **sqlite_header.file_change_counter()
75 ));
76
77 output.push_str(&format!(
78 "{label: <w$}{value}\n",
79 w = LABEL_WIDTH,
80 label = "database page count:",
81 value = **sqlite_header.db_filesize_in_pages()
82 ));
83
84 output.push_str(&format!(
85 "{label: <w$}{value}\n",
86 w = LABEL_WIDTH,
87 label = "freelist page count:",
88 value = **sqlite_header.freelist_pages().total()
89 ));
90
91 output.push_str(&format!(
92 "{label: <w$}{value}\n",
93 w = LABEL_WIDTH,
94 label = "schema cookie:",
95 value = **sqlite_header.schema_cookie()
96 ));
97
98 output.push_str(&format!(
99 "{label: <w$}{value}\n",
100 w = LABEL_WIDTH,
101 label = "schema format:",
102 value = u32::from(sqlite_header.schema_format())
103 ));
104
105 output.push_str(&format!(
106 "{label: <w$}{value}\n",
107 w = LABEL_WIDTH,
108 label = "default cache size:",
109 value = **sqlite_header.suggested_cache_size()
110 ));
111
112 output.push_str(&format!(
113 "{label: <w$}{value}\n",
114 w = LABEL_WIDTH,
115 label = "autovacuum top root:",
116 value = **sqlite_header
117 .incremental_vacuum_settings()
118 .largest_root_btree_page()
119 ));
120
121 output.push_str(&format!(
122 "{label: <w$}{value}\n",
123 w = LABEL_WIDTH,
124 label = "incremental vacuum:",
125 value = u32::from(
126 sqlite_header
127 .incremental_vacuum_settings()
128 .incremental_vacuum_mode()
129 )
130 ));
131
132 output.push_str(&format!(
133 "{label: <w$}{value}\n",
134 w = LABEL_WIDTH,
135 label = "text encoding:",
136 value = sqlite_header.database_text_encoding()
137 ));
138
139 output.push_str(&format!(
140 "{label: <w$}{value}\n",
141 w = LABEL_WIDTH,
142 label = "user version:",
143 value = **sqlite_header.user_version()
144 ));
145
146 output.push_str(&format!(
147 "{label: <w$}{value}\n",
148 w = LABEL_WIDTH,
149 label = "application id:",
150 value = **sqlite_header.application_id()
151 ));
152
153 output.push_str(&format!(
154 "{label: <w$}{value}\n",
155 w = LABEL_WIDTH,
156 label = "software version:",
157 value = **sqlite_header.write_library_version()
158 ));
159
160 println!("{output}");
161 Ok(())
162 }
Sourcepub fn incremental_vacuum_mode(&self) -> &IncrementalVacuumMode
pub fn incremental_vacuum_mode(&self) -> &IncrementalVacuumMode
Examples found in repository?
examples/sqlite_info.rs (line 128)
36 fn print_sqlite_info(conn: &SqliteConnection) -> AppResult<()> {
37 const LABEL_WIDTH: usize = 21;
38
39 // TODO:
40 let sqlite_header = conn.runtime().header();
41
42 let mut output = "".to_owned();
43
44 output.push_str(&format!(
45 "{label: <w$}{value}\n",
46 w = LABEL_WIDTH,
47 label = "database page size:",
48 value = u32::from(sqlite_header.page_size())
49 ));
50 output.push_str(&format!(
51 "{label: <w$}{value}\n",
52 w = LABEL_WIDTH,
53 label = "write format:",
54 value =
55 u8::from(sqlite_header.file_format_version_numbers().write_version())
56 ));
57 output.push_str(&format!(
58 "{label: <w$}{value}\n",
59 w = LABEL_WIDTH,
60 label = "read format:",
61 value =
62 u8::from(sqlite_header.file_format_version_numbers().read_version())
63 ));
64 output.push_str(&format!(
65 "{label: <w$}{value}\n",
66 w = LABEL_WIDTH,
67 label = "reserved bytes:",
68 value = **sqlite_header.reserved_bytes_per_page()
69 ));
70 output.push_str(&format!(
71 "{label: <w$}{value}\n",
72 w = LABEL_WIDTH,
73 label = "file change counter:",
74 value = **sqlite_header.file_change_counter()
75 ));
76
77 output.push_str(&format!(
78 "{label: <w$}{value}\n",
79 w = LABEL_WIDTH,
80 label = "database page count:",
81 value = **sqlite_header.db_filesize_in_pages()
82 ));
83
84 output.push_str(&format!(
85 "{label: <w$}{value}\n",
86 w = LABEL_WIDTH,
87 label = "freelist page count:",
88 value = **sqlite_header.freelist_pages().total()
89 ));
90
91 output.push_str(&format!(
92 "{label: <w$}{value}\n",
93 w = LABEL_WIDTH,
94 label = "schema cookie:",
95 value = **sqlite_header.schema_cookie()
96 ));
97
98 output.push_str(&format!(
99 "{label: <w$}{value}\n",
100 w = LABEL_WIDTH,
101 label = "schema format:",
102 value = u32::from(sqlite_header.schema_format())
103 ));
104
105 output.push_str(&format!(
106 "{label: <w$}{value}\n",
107 w = LABEL_WIDTH,
108 label = "default cache size:",
109 value = **sqlite_header.suggested_cache_size()
110 ));
111
112 output.push_str(&format!(
113 "{label: <w$}{value}\n",
114 w = LABEL_WIDTH,
115 label = "autovacuum top root:",
116 value = **sqlite_header
117 .incremental_vacuum_settings()
118 .largest_root_btree_page()
119 ));
120
121 output.push_str(&format!(
122 "{label: <w$}{value}\n",
123 w = LABEL_WIDTH,
124 label = "incremental vacuum:",
125 value = u32::from(
126 sqlite_header
127 .incremental_vacuum_settings()
128 .incremental_vacuum_mode()
129 )
130 ));
131
132 output.push_str(&format!(
133 "{label: <w$}{value}\n",
134 w = LABEL_WIDTH,
135 label = "text encoding:",
136 value = sqlite_header.database_text_encoding()
137 ));
138
139 output.push_str(&format!(
140 "{label: <w$}{value}\n",
141 w = LABEL_WIDTH,
142 label = "user version:",
143 value = **sqlite_header.user_version()
144 ));
145
146 output.push_str(&format!(
147 "{label: <w$}{value}\n",
148 w = LABEL_WIDTH,
149 label = "application id:",
150 value = **sqlite_header.application_id()
151 ));
152
153 output.push_str(&format!(
154 "{label: <w$}{value}\n",
155 w = LABEL_WIDTH,
156 label = "software version:",
157 value = **sqlite_header.write_library_version()
158 ));
159
160 println!("{output}");
161 Ok(())
162 }
Trait Implementations§
Source§impl Debug for IncrementalVacuumSettings
impl Debug for IncrementalVacuumSettings
Source§impl Default for IncrementalVacuumSettings
impl Default for IncrementalVacuumSettings
Source§fn default() -> IncrementalVacuumSettings
fn default() -> IncrementalVacuumSettings
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for IncrementalVacuumSettings
impl RefUnwindSafe for IncrementalVacuumSettings
impl Send for IncrementalVacuumSettings
impl Sync for IncrementalVacuumSettings
impl Unpin for IncrementalVacuumSettings
impl UnwindSafe for IncrementalVacuumSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more