[−][src]Struct track::Tracker
Tracks value modifications of a type and sends events with these changes.
The Tracker implements DerefMut which makes it possible to treat this tracker as if you are working with the type you track. On Drop it checks if modifications have been made. If this is the case only the modified fields in an event will be sent to the given sender.
Methods
impl<'borrow, 'notifier, C, S, I> Tracker<'borrow, 'notifier, C, S, I> where
C: TrackableMarker,
S: SerializationStrategy,
I: Identifier,
[src]
C: TrackableMarker,
S: SerializationStrategy,
I: Identifier,
pub fn new(
borrow: &'borrow mut C,
notifier: &'notifier Sender<ModificationEvent<I>>,
serialization: S,
identifier: I
) -> Tracker<'borrow, 'notifier, C, S, I>
[src]
borrow: &'borrow mut C,
notifier: &'notifier Sender<ModificationEvent<I>>,
serialization: S,
identifier: I
) -> Tracker<'borrow, 'notifier, C, S, I>
Constructs a new tracker.
borrow
: mutable reference to the object which modifications are tracked.notifier
: a sender where mutation events are sent.serialization
: an instance of a type that implements SerializationStrategy strategy. This serializer is needed to monitor the changes and the serialized mutations are sent along with the event.identifier
: An identifier with which you can relate the modification event to your type. The identifier should implement Identifier
Trait Implementations
impl<'borrow, 'notifier, C, S, I> Deref for Tracker<'borrow, 'notifier, C, S, I> where
C: TrackableMarker,
S: SerializationStrategy,
I: Identifier,
[src]
C: TrackableMarker,
S: SerializationStrategy,
I: Identifier,
type Target = C
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
Returns a reference to the underlying type being tracked.
impl<'borrow, 'notifier, C, S, I> DerefMut for Tracker<'borrow, 'notifier, C, S, I> where
C: TrackableMarker,
S: SerializationStrategy,
I: Identifier,
[src]
C: TrackableMarker,
S: SerializationStrategy,
I: Identifier,
fn deref_mut(&mut self) -> &mut Self::Target
[src]
Returns a mutable reference to the underlying type being tracked.
impl<'borrow, 'notifier, C, S, I> Drop for Tracker<'borrow, 'notifier, C, S, I> where
C: TrackableMarker,
S: SerializationStrategy,
I: Identifier,
[src]
C: TrackableMarker,
S: SerializationStrategy,
I: Identifier,
Auto Trait Implementations
impl<'borrow, 'notifier, C, S, I> RefUnwindSafe for Tracker<'borrow, 'notifier, C, S, I> where
C: RefUnwindSafe,
I: RefUnwindSafe,
S: RefUnwindSafe,
C: RefUnwindSafe,
I: RefUnwindSafe,
S: RefUnwindSafe,
impl<'borrow, 'notifier, C, S, I> Send for Tracker<'borrow, 'notifier, C, S, I>
impl<'borrow, 'notifier, C, S, I> Sync for Tracker<'borrow, 'notifier, C, S, I>
impl<'borrow, 'notifier, C, S, I> Unpin for Tracker<'borrow, 'notifier, C, S, I> where
C: Unpin,
I: Unpin,
S: Unpin,
C: Unpin,
I: Unpin,
S: Unpin,
impl<'borrow, 'notifier, C, S, I> !UnwindSafe for Tracker<'borrow, 'notifier, C, S, I>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,