pub enum ExpiredChannelCleanup {
Disabled,
Enabled {
timeout_in_secs: u64,
},
}Expand description
Policy governing automatic removal of expired Pending channels.
crate::protocol::DeRecProtocol::process consults this on every
call. It does not affect
crate::protocol::DeRecProtocol::remove_expired_channels, which
always sweeps at the threshold it is given — that is what makes
Self::Disabled mean “the application drives cleanup itself”
rather than “cleanup never happens”.
Configured via
crate::protocol::types::Timeouts::expired_channels.
Variants§
Disabled
No automatic sweep during process(). The application drives
cleanup itself via
crate::protocol::DeRecProtocol::remove_expired_channels.
Enabled
process() removes Pending channels older than this.
Implementations§
Source§impl ExpiredChannelCleanup
impl ExpiredChannelCleanup
Sourcepub fn from_secs(secs: u64) -> Self
pub fn from_secs(secs: u64) -> Self
Enable automatic cleanup with the given timeout.
Performs no validation. A zero is clamped to one second by
crate::protocol::types::Timeouts::expired_channels,
the single normalization point.
Sourcepub fn new(enabled: bool, timeout_in_secs: u64) -> Self
pub fn new(enabled: bool, timeout_in_secs: u64) -> Self
Build a policy from the flat (enabled, timeout_in_secs) pair the
FFI and WASM layers carry. When enabled is false the timeout is
ignored and the result is Self::Disabled.
This is the marshalling seam for the SDKs: they forward both values verbatim and this function decides what they mean, so the rule is written and tested once rather than in every binding.
Trait Implementations§
Source§impl Clone for ExpiredChannelCleanup
impl Clone for ExpiredChannelCleanup
impl Copy for ExpiredChannelCleanup
Source§impl Debug for ExpiredChannelCleanup
impl Debug for ExpiredChannelCleanup
Source§impl Default for ExpiredChannelCleanup
impl Default for ExpiredChannelCleanup
Source§impl<'de> Deserialize<'de> for ExpiredChannelCleanup
impl<'de> Deserialize<'de> for ExpiredChannelCleanup
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ExpiredChannelCleanup
Source§impl PartialEq for ExpiredChannelCleanup
impl PartialEq for ExpiredChannelCleanup
Source§impl Serialize for ExpiredChannelCleanup
impl Serialize for ExpiredChannelCleanup
impl StructuralPartialEq for ExpiredChannelCleanup
Auto Trait Implementations§
impl Forget for ExpiredChannelCleanup
impl Freeze for ExpiredChannelCleanup
impl Move for ExpiredChannelCleanup
impl RefUnwindSafe for ExpiredChannelCleanup
impl Send for ExpiredChannelCleanup
impl Sync for ExpiredChannelCleanup
impl Unpin for ExpiredChannelCleanup
impl UnsafeUnpin for ExpiredChannelCleanup
impl UnwindSafe for ExpiredChannelCleanup
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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