Enum bitcoin_peerman::State
source · #[repr(u8)]
pub enum State {
CANDIDATE_DELAYED,
CANDIDATE_READY,
CANDIDATE_BEST,
REQUESTED,
COMPLETED,
}Expand description
| The various states a (txhash,peer) pair can be | in. | | Note that CANDIDATE is split up into | 3 substates (DELAYED, BEST, READY), allowing | more efficient implementation. Also note that | the sorting order of ByTxHashView relies on the | specific order of values in this enum. | | Expected behaviour is: | | - When first announced by a peer, the state | is CANDIDATE_DELAYED until reqtime is | reached. | | - Announcements that have reached their | reqtime but not been requested will be | either CANDIDATE_READY or | CANDIDATE_BEST. Neither of those has an | expiration time; they remain in that state | until they’re requested or no longer | needed. CANDIDATE_READY announcements are | promoted to CANDIDATE_BEST when they’re the | best one left. | | - When requested, an announcement will be in | state REQUESTED until expiry is reached. | | - If expiry is reached, or the peer replies | to the request (either with NOTFOUND or the | tx), the state becomes COMPLETED.
Variants§
CANDIDATE_DELAYED
| A CANDIDATE announcement whose reqtime | is in the future. |
CANDIDATE_READY
| A CANDIDATE announcement that’s not | CANDIDATE_DELAYED or CANDIDATE_BEST. |
CANDIDATE_BEST
| The best CANDIDATE for a given txhash; | only if there is no REQUESTED announcement | already for that txhash. | | The CANDIDATE_BEST is the highest-priority | announcement among all CANDIDATE_READY | (and _BEST) ones for that txhash. |
REQUESTED
| A REQUESTED announcement. |
COMPLETED
| A COMPLETED announcement. |
Trait Implementations§
source§impl PartialEq<State> for State
impl PartialEq<State> for State
impl Eq for State
impl StructuralEq for State
impl StructuralPartialEq for State
Auto Trait Implementations§
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
Blanket Implementations§
§impl<T, U> CastInto<U> for Twhere
U: CastFrom<T>,
impl<T, U> CastInto<U> for Twhere U: CastFrom<T>,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.