Struct ChannelSelector
pub struct ChannelSelector {
pub source: Option<Address>,
pub destination: Option<Address>,
pub id: Option<HashBase<CoreWrapper<Keccak256Core>>>,
pub allowed_states: Vec<ChannelStatusDiscriminants>,
pub closure_time_range: (Bound<DateTime<Utc>>, Bound<DateTime<Utc>>),
}Expand description
Selector for channels.
Fields§
§source: Option<Address>Filter by source address.
destination: Option<Address>Filter by destination address
id: Option<HashBase<CoreWrapper<Keccak256Core>>>Filter by channel id.
allowed_states: Vec<ChannelStatusDiscriminants>Filter by possible channel states.
closure_time_range: (Bound<DateTime<Utc>>, Bound<DateTime<Utc>>)Range of closure times if PendingToClose was specified in allowed_states,
otherwise has no effect.
Implementations§
§impl ChannelSelector
impl ChannelSelector
pub fn with_source<A>(self, address: A) -> ChannelSelector
pub fn with_source<A>(self, address: A) -> ChannelSelector
Sets the source bound on a channel.
If id was previously set, it will be unset.
pub fn with_destination<A>(self, address: A) -> ChannelSelector
pub fn with_destination<A>(self, address: A) -> ChannelSelector
Sets the destination bound on a channel.
If id was previously set, it will be unset.
pub fn with_id(
self,
id: HashBase<CoreWrapper<Keccak256Core>>,
) -> ChannelSelector
pub fn with_id( self, id: HashBase<CoreWrapper<Keccak256Core>>, ) -> ChannelSelector
Sets the id bound on a channel.
If source or destination were previously set, they will be unset.
pub fn with_allowed_states(
self,
allowed_states: &[ChannelStatusDiscriminants],
) -> ChannelSelector
pub fn with_allowed_states( self, allowed_states: &[ChannelStatusDiscriminants], ) -> ChannelSelector
Sets the allowed channel states.
pub fn with_closure_time_range<T>(self, range: T) -> ChannelSelector
pub fn with_closure_time_range<T>(self, range: T) -> ChannelSelector
Sets the channel closure range.
This has an effect only if PendingToClose is set in the allowed states.
pub fn with_redeemable_channels(
self,
min_grace_period: Option<Duration>,
) -> ChannelSelector
pub fn with_redeemable_channels( self, min_grace_period: Option<Duration>, ) -> ChannelSelector
Convenience method to include all effectively open channels -
channels which are open or pending to close with closure time in the future with at least min_grace_period.
In these channels, ticket redemption of incoming tickets is still possible.
pub fn satisfies(&self, channel: &ChannelEntry) -> bool
pub fn satisfies(&self, channel: &ChannelEntry) -> bool
Checks if the given channel satisfies the selector.
Trait Implementations§
§impl Clone for ChannelSelector
impl Clone for ChannelSelector
§fn clone(&self) -> ChannelSelector
fn clone(&self) -> ChannelSelector
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ChannelSelector
impl Debug for ChannelSelector
§impl Default for ChannelSelector
impl Default for ChannelSelector
§fn default() -> ChannelSelector
fn default() -> ChannelSelector
§impl PartialEq for ChannelSelector
impl PartialEq for ChannelSelector
impl Eq for ChannelSelector
impl StructuralPartialEq for ChannelSelector
Auto Trait Implementations§
impl Freeze for ChannelSelector
impl RefUnwindSafe for ChannelSelector
impl Send for ChannelSelector
impl Sync for ChannelSelector
impl Unpin for ChannelSelector
impl UnwindSafe for ChannelSelector
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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