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 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 CockHandler
impl Debug for CockHandler
Source§impl<'de> Deserialize<'de> for CockHandler
impl<'de> Deserialize<'de> for CockHandler
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for CockHandler
This implementation of std::fmt::Display allows a CockHandler to be converted to a string for easy display.
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 Freeze for CockHandler
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