Trait Track

Source
pub trait Track: Surfaces {
    type Call: Call;

    // Required methods
    fn call(&self, call: &Self::Call) -> u128;
    fn call_mut(&mut self, call: &Self::Call);

    // Provided methods
    fn track(&self) -> Tracked<'_, Self> { ... }
    fn track_mut(&mut self) -> TrackedMut<'_, Self> { ... }
    fn track_with<'a>(
        &'a self,
        sink: &'a dyn Sink<Call = Self::Call>,
    ) -> Tracked<'a, Self> { ... }
    fn track_mut_with<'a>(
        &'a mut self,
        sink: &'a dyn Sink<Call = Self::Call>,
    ) -> TrackedMut<'a, Self> { ... }
}
Expand description

A trackable type.

This is implemented by types that have an implementation block annotated with #[track] and for trait objects whose traits are annotated with #[track]. For more details, see its documentation.

Required Associated Types§

Source

type Call: Call

An enumeration of possible tracked calls that can be performed on this tracked type.

Required Methods§

Source

fn call(&self, call: &Self::Call) -> u128

Performs a call on the value and returns the hash of its results.

Source

fn call_mut(&mut self, call: &Self::Call)

Performs a mutable call on the value.

Provided Methods§

Source

fn track(&self) -> Tracked<'_, Self>

Start tracking all accesses to a value.

Source

fn track_mut(&mut self) -> TrackedMut<'_, Self>

Start tracking all accesses and mutations to a value.

Source

fn track_with<'a>( &'a self, sink: &'a dyn Sink<Call = Self::Call>, ) -> Tracked<'a, Self>

Start tracking all accesses into a sink.

Source

fn track_mut_with<'a>( &'a mut self, sink: &'a dyn Sink<Call = Self::Call>, ) -> TrackedMut<'a, Self>

Start tracking all accesses and mutations into a sink.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§