pub enum AssignmentMethod {
Deterministic,
Random,
}Expand description
How to assign a user to a variant.
Variants§
Deterministic
Hash the user ID deterministically — the same user always gets the same variant.
Random
Not truly random in this context; provided for API completeness. Uses the same FNV-1a path because we have no PRNG state here.
Trait Implementations§
Source§impl Clone for AssignmentMethod
impl Clone for AssignmentMethod
Source§fn clone(&self) -> AssignmentMethod
fn clone(&self) -> AssignmentMethod
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AssignmentMethod
Source§impl Debug for AssignmentMethod
impl Debug for AssignmentMethod
impl Eq for AssignmentMethod
Source§impl PartialEq for AssignmentMethod
impl PartialEq for AssignmentMethod
Source§fn eq(&self, other: &AssignmentMethod) -> bool
fn eq(&self, other: &AssignmentMethod) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for AssignmentMethod
Auto Trait Implementations§
impl Freeze for AssignmentMethod
impl RefUnwindSafe for AssignmentMethod
impl Send for AssignmentMethod
impl Sync for AssignmentMethod
impl Unpin for AssignmentMethod
impl UnsafeUnpin for AssignmentMethod
impl UnwindSafe for AssignmentMethod
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more