Struct cock_lib::CockHandler
source · pub struct CockHandler {
pub id: ID,
pub cock: CockStruct,
}Expand description
This struct handles all operations related to the CockStruct entity. It keeps track of an identifier and the CockStruct itself.
Fields§
§id: ID§cock: CockStructImplementations§
source§impl CockHandler
impl CockHandler
sourcepub fn new(id: ID, cock: CockStruct) -> CockHandler
pub fn new(id: ID, cock: CockStruct) -> CockHandler
Constructor for a new CockHandler
sourcepub fn total_score(&self) -> CockResult
pub fn total_score(&self) -> CockResult
This method calculates the total score for the current CockStruct. The calculation takes into account several attributes of the CockStruct. It returns a CockResult containing the raw score and the percentage score.
sourcepub fn grade(&self) -> Tier
pub fn grade(&self) -> Tier
This method determines the grade for the current CockStruct. The grade is based on the percentage score.
Trait Implementations§
source§impl Clone for CockHandler
impl Clone for CockHandler
source§fn clone(&self) -> CockHandler
fn clone(&self) -> CockHandler
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 Debug for CockHandler
impl Debug for CockHandler
source§impl Display for CockHandler
impl Display for CockHandler
This implementation of std::fmt::Display allows a CockHandler to be converted to a string for easy display.
Auto Trait Implementations§
impl RefUnwindSafe for CockHandler
impl Send for CockHandler
impl Sync for CockHandler
impl Unpin for CockHandler
impl UnwindSafe for CockHandler
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