Struct roles_logic_sv2::selectors::GeneralMiningSelector
source · pub struct GeneralMiningSelector<Sel: DownstreamMiningSelector<Down>, Down: IsMiningDownstream, Up: IsMiningUpstream<Down, Sel>> {
pub upstreams: Vec<Arc<Mutex<Up>>>,
pub id_to_upstream: HashMap<u32, Arc<Mutex<Up>>, BuildNoHashHasher<u32>>,
/* private fields */
}
Expand description
Upstream selector is used to chose between a set of known mining upstream nodes which one/ones can accept messages from a specific mining downstream node
Fields§
§upstreams: Vec<Arc<Mutex<Up>>>
§id_to_upstream: HashMap<u32, Arc<Mutex<Up>>, BuildNoHashHasher<u32>>
Implementations§
source§impl<Sel: DownstreamMiningSelector<Down>, Up: IsMiningUpstream<Down, Sel>, Down: IsMiningDownstream> GeneralMiningSelector<Sel, Down, Up>
impl<Sel: DownstreamMiningSelector<Down>, Up: IsMiningUpstream<Down, Sel>, Down: IsMiningDownstream> GeneralMiningSelector<Sel, Down, Up>
Trait Implementations§
source§impl<Sel: Debug + DownstreamMiningSelector<Down>, Down: Debug + IsMiningDownstream, Up: Debug + IsMiningUpstream<Down, Sel>> Debug for GeneralMiningSelector<Sel, Down, Up>
impl<Sel: Debug + DownstreamMiningSelector<Down>, Down: Debug + IsMiningDownstream, Up: Debug + IsMiningUpstream<Down, Sel>> Debug for GeneralMiningSelector<Sel, Down, Up>
source§impl<Sel: DownstreamMiningSelector<Down>, Down: IsMiningDownstream, Up: IsMiningUpstream<Down, Sel>> UpstreamMiningSelctor<Down, Up, Sel> for GeneralMiningSelector<Sel, Down, Up>
impl<Sel: DownstreamMiningSelector<Down>, Down: IsMiningDownstream, Up: IsMiningUpstream<Down, Sel>> UpstreamMiningSelctor<Down, Up, Sel> for GeneralMiningSelector<Sel, Down, Up>
source§fn on_setup_connection(
&mut self,
pair_settings: &PairSettings
) -> Result<(Vec<Arc<Mutex<Up>>>, u32), Error>
fn on_setup_connection( &mut self, pair_settings: &PairSettings ) -> Result<(Vec<Arc<Mutex<Up>>>, u32), Error>
Return the set of mining upstream nodes that can accept messages from a downstream with the passed PairSettings and the sum of all the accepted flags
fn get_upstream(&self, upstream_id: u32) -> Option<Arc<Mutex<Up>>>
impl<Sel: DownstreamMiningSelector<Down>, Down: IsMiningDownstream, Up: IsMiningUpstream<Down, Sel>> UpstreamSelector for GeneralMiningSelector<Sel, Down, Up>
Auto Trait Implementations§
impl<Sel, Down, Up> Freeze for GeneralMiningSelector<Sel, Down, Up>
impl<Sel, Down, Up> RefUnwindSafe for GeneralMiningSelector<Sel, Down, Up>where
Sel: RefUnwindSafe,
Down: RefUnwindSafe,
impl<Sel, Down, Up> Send for GeneralMiningSelector<Sel, Down, Up>
impl<Sel, Down, Up> Sync for GeneralMiningSelector<Sel, Down, Up>
impl<Sel, Down, Up> Unpin for GeneralMiningSelector<Sel, Down, Up>
impl<Sel, Down, Up> UnwindSafe for GeneralMiningSelector<Sel, Down, Up>where
Sel: UnwindSafe,
Down: UnwindSafe,
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