pub struct DefaultReputationHook;Expand description
Default hook that does nothing
Trait Implementations§
Source§impl Clone for DefaultReputationHook
impl Clone for DefaultReputationHook
Source§fn clone(&self) -> DefaultReputationHook
fn clone(&self) -> DefaultReputationHook
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 DefaultReputationHook
Source§impl Debug for DefaultReputationHook
impl Debug for DefaultReputationHook
Source§impl Default for DefaultReputationHook
impl Default for DefaultReputationHook
Source§fn default() -> DefaultReputationHook
fn default() -> DefaultReputationHook
Returns the “default value” for a type. Read more
Source§impl ReputationHook for DefaultReputationHook
impl ReputationHook for DefaultReputationHook
Source§fn on_reputation_changed<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_subject_id: &'life1 SubjectId,
_old_score: f32,
_new_score: f32,
_delta: f32,
_category: Option<&'life2 str>,
_resources: &'life3 mut ResourceContext,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn on_reputation_changed<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_subject_id: &'life1 SubjectId,
_old_score: f32,
_new_score: f32,
_delta: f32,
_category: Option<&'life2 str>,
_resources: &'life3 mut ResourceContext,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Called when reputation is changed Read more
Source§fn on_threshold_crossed<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
_subject_id: &'life1 SubjectId,
_old_threshold: Option<&'life2 ReputationThreshold>,
_new_threshold: &'life3 ReputationThreshold,
_resources: &'life4 mut ResourceContext,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn on_threshold_crossed<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
_subject_id: &'life1 SubjectId,
_old_threshold: Option<&'life2 ReputationThreshold>,
_new_threshold: &'life3 ReputationThreshold,
_resources: &'life4 mut ResourceContext,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Called when reputation crosses a threshold Read more
Source§fn validate_change<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_subject_id: &'life1 SubjectId,
_delta: f32,
_category: Option<&'life2 str>,
_resources: &'life3 ResourceContext,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn validate_change<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_subject_id: &'life1 SubjectId,
_delta: f32,
_category: Option<&'life2 str>,
_resources: &'life3 ResourceContext,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Validate whether a reputation change is allowed Read more
Source§fn calculate_delta<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_subject_id: &'life1 SubjectId,
base_delta: f32,
_category: Option<&'life2 str>,
_resources: &'life3 ResourceContext,
) -> Pin<Box<dyn Future<Output = f32> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn calculate_delta<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_subject_id: &'life1 SubjectId,
base_delta: f32,
_category: Option<&'life2 str>,
_resources: &'life3 ResourceContext,
) -> Pin<Box<dyn Future<Output = f32> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Calculate effective delta with game-specific modifiers Read more
Auto Trait Implementations§
impl Freeze for DefaultReputationHook
impl RefUnwindSafe for DefaultReputationHook
impl Send for DefaultReputationHook
impl Sync for DefaultReputationHook
impl Unpin for DefaultReputationHook
impl UnsafeUnpin for DefaultReputationHook
impl UnwindSafe for DefaultReputationHook
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,
impl<T> Component for T
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