pub struct ObserverRegistry<T> { /* private fields */ }Implementations§
Source§impl<T> ObserverRegistry<T>
impl<T> ObserverRegistry<T>
pub fn new() -> Self
pub fn register(&mut self, observer: Box<dyn ModelObserver<T>>)
pub fn observer_count(&self) -> usize
pub async fn trigger_creating(&self, model: &mut T) -> Result<(), EventError>
pub async fn trigger_created(&self, model: &T) -> Result<(), EventError>
pub async fn trigger_updating( &self, model: &mut T, original: &T, ) -> Result<(), EventError>
pub async fn trigger_updated( &self, model: &T, original: &T, ) -> Result<(), EventError>
pub async fn trigger_saving(&self, model: &mut T) -> Result<(), EventError>
pub async fn trigger_saved(&self, model: &T) -> Result<(), EventError>
pub async fn trigger_deleting(&self, model: &T) -> Result<(), EventError>
pub async fn trigger_deleted(&self, model: &T) -> Result<(), EventError>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ObserverRegistry<T>
impl<T> !RefUnwindSafe for ObserverRegistry<T>
impl<T> Send for ObserverRegistry<T>
impl<T> Sync for ObserverRegistry<T>
impl<T> Unpin for ObserverRegistry<T>
impl<T> !UnwindSafe for ObserverRegistry<T>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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