pub struct Individual<T> { /* private fields */ }
Expand description
Individual for Group
.
A target value with id.
T
- A type of value.
§Example
use scarlet_queen_core::each_individual::Individual;
let sample: Individual<u8> = Individual::new(5);
assert_eq!(sample.get_id(), 0usize);
assert_eq!(sample.get_value(), &5u8);
sample.set_id(1);
assert_eq!(sample.get_id(), 1usize);
Implementations§
Source§impl<T> Individual<T>
impl<T> Individual<T>
Sourcepub fn new(value: T) -> Individual<T>
pub fn new(value: T) -> Individual<T>
Make individual from value.
value
- A target value.
Sourcepub fn new_with_id(id: usize, value: T) -> Individual<T>
pub fn new_with_id(id: usize, value: T) -> Individual<T>
Make individual from value and id.
id
- An id.value
- A target value.
Trait Implementations§
Source§impl<T: Clone> Clone for Individual<T>
impl<T: Clone> Clone for Individual<T>
Source§fn clone(&self) -> Individual<T>
fn clone(&self) -> Individual<T>
Returns a copy 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<T: Debug> Debug for Individual<T>
impl<T: Debug> Debug for Individual<T>
Source§impl<T: PartialEq> PartialEq for Individual<T>
impl<T: PartialEq> PartialEq for Individual<T>
impl<T: Eq> Eq for Individual<T>
impl<T> StructuralPartialEq for Individual<T>
Auto Trait Implementations§
impl<T> !Freeze for Individual<T>
impl<T> !RefUnwindSafe for Individual<T>
impl<T> Send for Individual<T>where
T: Send,
impl<T> !Sync for Individual<T>
impl<T> Unpin for Individual<T>where
T: Unpin,
impl<T> UnwindSafe for Individual<T>where
T: 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