Skip to content

Commit e0b9e21

Browse files
committed
reorder types, add docs
1 parent a02168f commit e0b9e21

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

crates/storage/provider/src/either_writer.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ pub enum EitherWriter<'a, CURSOR, N> {
1818
StaticFile(StaticFileProviderRWRefMut<'a, N>),
1919
}
2020

21-
#[derive(Debug, EnumIs)]
22-
#[allow(missing_docs)]
23-
pub enum EitherWriterDestination {
24-
Database,
25-
StaticFile,
26-
}
27-
2821
impl EitherWriter<'_, (), ()> {
2922
/// Returns the destination for writing receipts.
23+
///
24+
/// The rules are as follows:
25+
/// - If the node should not always write receipts to static files, and any receipt pruning is
26+
/// enabled, write to the database.
27+
/// - If the node should always write receipts to static files, but receipt log filter pruning
28+
/// is enabled, write to the database.
29+
/// - Otherwise, write to static files.
3030
pub fn receipts_destination<P: DBProvider + StorageSettingsCache>(
3131
provider: &P,
3232
) -> EitherWriterDestination {
@@ -44,6 +44,13 @@ impl EitherWriter<'_, (), ()> {
4444
}
4545
}
4646

47+
#[derive(Debug, EnumIs)]
48+
#[allow(missing_docs)]
49+
pub enum EitherWriterDestination {
50+
Database,
51+
StaticFile,
52+
}
53+
4754
impl<'a, CURSOR, N: NodePrimitives> EitherWriter<'a, CURSOR, N> {
4855
/// Increment the block number.
4956
///

0 commit comments

Comments
 (0)