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