pub struct MatchmakingQueue { /* private fields */ }Implementations§
Source§impl MatchmakingQueue
impl MatchmakingQueue
pub fn new(match_size: usize) -> Self
Sourcepub fn enqueue(&mut self, entry: QueueEntry)
pub fn enqueue(&mut self, entry: QueueEntry)
Enqueue a player.
Sourcepub fn dequeue(&mut self, player_id: PlayerId) -> bool
pub fn dequeue(&mut self, player_id: PlayerId) -> bool
Remove a player from the queue (cancelled or timed out).
Sourcepub fn tick(&mut self) -> Vec<ProposedMatch>
pub fn tick(&mut self) -> Vec<ProposedMatch>
Attempt to form matches. Returns a list of proposed matches. Party members are kept together.
Sourcepub fn add_backfill(&mut self, job: BackfillJob)
pub fn add_backfill(&mut self, job: BackfillJob)
Register a backfill job (open slots in an ongoing game).
Sourcepub fn process_backfill(&mut self) -> Vec<(BackfillJob, Vec<PlayerId>)>
pub fn process_backfill(&mut self) -> Vec<(BackfillJob, Vec<PlayerId>)>
Try to fill backfill jobs from the queue.
Returns (BackfillJob, Vec
pub fn queue_len(&self) -> usize
pub fn backfill_count(&self) -> usize
Auto Trait Implementations§
impl Freeze for MatchmakingQueue
impl RefUnwindSafe for MatchmakingQueue
impl Send for MatchmakingQueue
impl Sync for MatchmakingQueue
impl Unpin for MatchmakingQueue
impl UnsafeUnpin for MatchmakingQueue
impl UnwindSafe for MatchmakingQueue
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.