@@ -49,21 +49,21 @@ static MIGRATIONS: LazyLock<Migrations> = LazyLock::new(|| {
4949
5050/// Our main database and integrated cache.
5151#[ derive( Clone ) ]
52- pub struct Database {
52+ pub ( crate ) struct Database {
5353 conn : Arc < Mutex < Connection > > ,
5454}
5555
5656/// Database opening modes
5757#[ derive( Debug ) ]
58- pub enum Open {
58+ pub ( crate ) enum Open {
5959 /// Open in-memory database that is wiped after reload
6060 Memory ,
6161 /// Open database from given path
6262 Path ( PathBuf ) ,
6363}
6464
6565/// Module with types for insertion.
66- pub mod write {
66+ pub ( crate ) mod write {
6767 use crate :: crypto:: { Encrypted , Password , Plaintext } ;
6868 use crate :: errors:: Error ;
6969 use async_compression:: tokio:: bufread:: ZstdEncoder ;
@@ -74,7 +74,7 @@ pub mod write {
7474
7575 /// An uncompressed entry to be inserted into the database.
7676 #[ derive( Default , Debug , Serialize , Deserialize ) ]
77- pub struct Entry {
77+ pub ( crate ) struct Entry {
7878 /// Content
7979 pub text : String ,
8080 /// File extension
@@ -92,15 +92,15 @@ pub mod write {
9292 }
9393
9494 /// A compressed entry to be inserted.
95- pub struct CompressedEntry {
95+ pub ( crate ) struct CompressedEntry {
9696 /// Original data
9797 entry : Entry ,
9898 /// Compressed data
9999 data : Vec < u8 > ,
100100 }
101101
102102 /// An entry that might be encrypted.
103- pub struct DatabaseEntry {
103+ pub ( crate ) struct DatabaseEntry {
104104 /// Original data
105105 pub entry : Entry ,
106106 /// Compressed and potentially encrypted data
@@ -147,7 +147,7 @@ pub mod write {
147147}
148148
149149/// Module with types for reading from the database.
150- pub mod read {
150+ pub ( crate ) mod read {
151151 use crate :: crypto:: { Encrypted , Password } ;
152152 use crate :: errors:: Error ;
153153 use async_compression:: tokio:: bufread:: ZstdDecoder ;
@@ -156,7 +156,7 @@ pub mod read {
156156
157157 /// A raw entry as read from the database.
158158 #[ derive( Debug ) ]
159- pub struct DatabaseEntry {
159+ pub ( crate ) struct DatabaseEntry {
160160 /// Compressed and potentially encrypted data
161161 pub data : Vec < u8 > ,
162162 /// Entry is expired
@@ -173,7 +173,7 @@ pub mod read {
173173
174174 /// Potentially decrypted but still compressed entry
175175 #[ derive( Debug ) ]
176- pub struct CompressedReadEntry {
176+ pub ( crate ) struct CompressedReadEntry {
177177 /// Compressed data
178178 data : Vec < u8 > ,
179179 /// Entry must be deleted
@@ -186,7 +186,7 @@ pub mod read {
186186
187187 /// Uncompressed entry
188188 #[ derive( Debug ) ]
189- pub struct UmcompressedEntry {
189+ pub ( crate ) struct UmcompressedEntry {
190190 /// Content
191191 pub text : String ,
192192 /// Entry must be deleted
@@ -199,7 +199,7 @@ pub mod read {
199199
200200 /// Uncompressed, decrypted data read from the database.
201201 #[ derive( Debug ) ]
202- pub struct Data {
202+ pub ( crate ) struct Data {
203203 /// Content
204204 pub text : String ,
205205 /// User identifier that inserted the entry
@@ -210,7 +210,7 @@ pub mod read {
210210
211211 /// Potentially deleted or non-existent expired entry.
212212 #[ derive( Debug ) ]
213- pub enum Entry {
213+ pub ( crate ) enum Entry {
214214 /// Entry found and still available.
215215 Regular ( Data ) ,
216216 /// Entry burned.
0 commit comments