pub struct DummyPersister;Expand description
A null persister for testing
Trait Implementations§
Source§impl Persist for DummyPersister
impl Persist for DummyPersister
Source§fn new_node(
&self,
node_id: &PublicKey,
config: &NodeConfig,
state: &NodeState,
) -> Result<(), Error>
fn new_node( &self, node_id: &PublicKey, config: &NodeConfig, state: &NodeState, ) -> Result<(), Error>
Create a new node
Source§fn update_node(
&self,
node_id: &PublicKey,
state: &NodeState,
) -> Result<(), Error>
fn update_node( &self, node_id: &PublicKey, state: &NodeState, ) -> Result<(), Error>
Update node enforcement state
Source§fn delete_node(&self, node_id: &PublicKey) -> Result<(), Error>
fn delete_node(&self, node_id: &PublicKey) -> Result<(), Error>
Delete a node and all of its channels. Used in test mode.
Source§fn new_channel(
&self,
node_id: &PublicKey,
stub: &ChannelStub,
) -> Result<(), Error>
fn new_channel( &self, node_id: &PublicKey, stub: &ChannelStub, ) -> Result<(), Error>
Will error if exists
Source§fn delete_channel(
&self,
node_id: &PublicKey,
channel_id: &ChannelId,
) -> Result<(), Error>
fn delete_channel( &self, node_id: &PublicKey, channel_id: &ChannelId, ) -> Result<(), Error>
Delete a channel
Source§fn new_tracker(
&self,
node_id: &PublicKey,
tracker: &ChainTracker<ChainMonitor>,
) -> Result<(), Error>
fn new_tracker( &self, node_id: &PublicKey, tracker: &ChainTracker<ChainMonitor>, ) -> Result<(), Error>
Create a new tracker
Source§fn update_tracker(
&self,
node_id: &PublicKey,
tracker: &ChainTracker<ChainMonitor>,
) -> Result<(), Error>
fn update_tracker( &self, node_id: &PublicKey, tracker: &ChainTracker<ChainMonitor>, ) -> Result<(), Error>
Update the tracker
Source§fn get_tracker(
&self,
node_id: PublicKey,
validator_factory: Arc<dyn ValidatorFactory>,
) -> Result<(ChainTracker<ChainMonitor>, Vec<ChainTrackerListenerEntry>), Error>
fn get_tracker( &self, node_id: PublicKey, validator_factory: Arc<dyn ValidatorFactory>, ) -> Result<(ChainTracker<ChainMonitor>, Vec<ChainTrackerListenerEntry>), Error>
Get the tracker
Source§fn update_channel(
&self,
node_id: &PublicKey,
channel: &Channel,
) -> Result<(), Error>
fn update_channel( &self, node_id: &PublicKey, channel: &Channel, ) -> Result<(), Error>
Will error if doesn’t exist. Read more
Source§fn get_channel(
&self,
node_id: &PublicKey,
channel_id: &ChannelId,
) -> Result<ChannelEntry, Error>
fn get_channel( &self, node_id: &PublicKey, channel_id: &ChannelId, ) -> Result<ChannelEntry, Error>
Get a channel from store
Source§fn get_node_channels(
&self,
node_id: &PublicKey,
) -> Result<Vec<(ChannelId, ChannelEntry)>, Error>
fn get_node_channels( &self, node_id: &PublicKey, ) -> Result<Vec<(ChannelId, ChannelEntry)>, Error>
Get all channels for a node from store
Source§fn update_node_allowlist(
&self,
node_id: &PublicKey,
allowlist: Vec<String>,
) -> Result<(), Error>
fn update_node_allowlist( &self, node_id: &PublicKey, allowlist: Vec<String>, ) -> Result<(), Error>
Persist the allowlist to the store.
Source§fn get_node_allowlist(&self, node_id: &PublicKey) -> Result<Vec<String>, Error>
fn get_node_allowlist(&self, node_id: &PublicKey) -> Result<Vec<String>, Error>
Get the allowlist from the store.
Source§fn prepare(&self) -> Mutations
fn prepare(&self) -> Mutations
Get the logged mutations since the last call to
enter(). Read moreSource§fn put_batch_unlogged(&self, _m: Mutations) -> Result<(), Error>
fn put_batch_unlogged(&self, _m: Mutations) -> Result<(), Error>
Update the persister with the given mutations. Read more
Source§fn on_initial_restore(&self) -> bool
fn on_initial_restore(&self) -> bool
Notifies the persister that the initial restore from persistence is done
and queries whether a sync is required. Read more
Source§fn recovery_required(&self) -> bool
fn recovery_required(&self) -> bool
Whether recovery from backup is required on signer startup.
Should return true if the persister is in a state where it
needs to recover from a backup (e.g. empty).
Auto Trait Implementations§
impl Freeze for DummyPersister
impl RefUnwindSafe for DummyPersister
impl Send for DummyPersister
impl Sync for DummyPersister
impl Unpin for DummyPersister
impl UnwindSafe for DummyPersister
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more