pub struct FirstAvailable;Expand description
Picks the first available candidate.
This is the default strategy when no other is configured.
§Example
use bubbles::saliency::{Candidate, FirstAvailable, SaliencyStrategy};
let mut s = FirstAvailable;
let candidates = vec![
Candidate { id: "a", available: false },
Candidate { id: "b", available: true },
Candidate { id: "c", available: true },
];
assert_eq!(s.select(&candidates), Some(1));Trait Implementations§
Source§impl Clone for FirstAvailable
impl Clone for FirstAvailable
Source§fn clone(&self) -> FirstAvailable
fn clone(&self) -> FirstAvailable
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FirstAvailable
impl Debug for FirstAvailable
Source§impl Default for FirstAvailable
impl Default for FirstAvailable
Source§fn default() -> FirstAvailable
fn default() -> FirstAvailable
Returns the “default value” for a type. Read more
Source§impl SaliencyStrategy for FirstAvailable
impl SaliencyStrategy for FirstAvailable
Auto Trait Implementations§
impl Freeze for FirstAvailable
impl RefUnwindSafe for FirstAvailable
impl Send for FirstAvailable
impl Sync for FirstAvailable
impl Unpin for FirstAvailable
impl UnsafeUnpin for FirstAvailable
impl UnwindSafe for FirstAvailable
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