Skip to content

Commit

Permalink
add CloneNoPersistence trait
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Aug 30, 2024
1 parent 9c6ab8f commit 54b4ad0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/persistence.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
use std::error::Error;
use std::fmt::Debug;

pub trait CloneNoPersistence: Sized {
fn clone_no_persistence(&self) -> Self;
}

#[derive(Debug, Display, Error)]
#[display(inner)]
pub struct PersistenceError(pub Box<dyn Error + Send>);
Expand Down Expand Up @@ -37,7 +41,7 @@ impl<T: Persisting> Persistence<T> {
}
}

pub trait Persisting: Sized {
pub trait Persisting: CloneNoPersistence {
#[inline]
fn load(
provider: impl PersistenceProvider<Self> + 'static,
Expand Down

0 comments on commit 54b4ad0

Please sign in to comment.