pub enum TimeoutWindow {
NoTimeout,
Timeout {
hard_timeout: BlockHeight,
soft_timeout: BlockHeight,
},
}Variants§
Implementations§
Source§impl TimeoutWindow
Creates a new timeout window with hard and soft timeout block heights.
impl TimeoutWindow
Creates a new timeout window with hard and soft timeout block heights.
This function automatically ensures that hard_timeout <= soft_timeout by
swapping the parameters if they are provided in the wrong order. If the
hard_timeout is greater than soft_timeout, the values will be swapped
internally to maintain the invariant that hard timeout should occur before
or at the same time as the soft timeout.
§Parameters
hard_timeout- The block height for the hard timeout (will be the earlier timeout)soft_timeout- The block height for the soft timeout (will be the later timeout)
§Returns
A TimeoutWindow::Timeout variant with properly ordered timeout values.
pub fn timeout(hard_timeout: BlockHeight, soft_timeout: BlockHeight) -> Self
Trait Implementations§
Source§impl BorshDeserialize for TimeoutWindow
impl BorshDeserialize for TimeoutWindow
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for TimeoutWindow
impl BorshSerialize for TimeoutWindow
Source§impl Clone for TimeoutWindow
impl Clone for TimeoutWindow
Source§fn clone(&self) -> TimeoutWindow
fn clone(&self) -> TimeoutWindow
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ComposeSchema for TimeoutWindow
impl ComposeSchema for TimeoutWindow
Source§impl Debug for TimeoutWindow
impl Debug for TimeoutWindow
Source§impl Default for TimeoutWindow
impl Default for TimeoutWindow
Source§impl<'de> Deserialize<'de> for TimeoutWindow
impl<'de> Deserialize<'de> for TimeoutWindow
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for TimeoutWindow
impl Display for TimeoutWindow
Source§impl EnumExt for TimeoutWindow
impl EnumExt for TimeoutWindow
Source§impl PartialEq for TimeoutWindow
impl PartialEq for TimeoutWindow
Source§impl Serialize for TimeoutWindow
impl Serialize for TimeoutWindow
Source§impl ToSchema for TimeoutWindow
impl ToSchema for TimeoutWindow
impl Eq for TimeoutWindow
impl StructuralPartialEq for TimeoutWindow
Auto Trait Implementations§
impl Freeze for TimeoutWindow
impl RefUnwindSafe for TimeoutWindow
impl Send for TimeoutWindow
impl Sync for TimeoutWindow
impl Unpin for TimeoutWindow
impl UnsafeUnpin for TimeoutWindow
impl UnwindSafe for TimeoutWindow
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.