Skip to main content

DebugAwareEventStore

Struct DebugAwareEventStore 

Source
pub struct DebugAwareEventStore<E: EventStore> { /* private fields */ }
Expand description

An EventStore that delegates to both a primary E: EventStore (owned) and a shared Arc<DebugEventStore> for the debug protocol.

The primary store is accessed via &mut self (normal EventStore contract). The debug store uses interior mutability (Mutex) so it can be shared with the protocol handler.

Implementations§

Source§

impl<E: EventStore> DebugAwareEventStore<E>

Source

pub fn new(primary: E, debug_store: Arc<DebugEventStore>) -> Self

Creates a new DebugAwareEventStore.

Source

pub fn primary(&self) -> &E

Returns a reference to the primary event store.

Source

pub fn primary_mut(&mut self) -> &mut E

Returns a mutable reference to the primary event store.

Source

pub fn debug_store(&self) -> Arc<DebugEventStore>

Returns a clone of the Arc<DebugEventStore>.

Trait Implementations§

Source§

impl<E> Debug for DebugAwareEventStore<E>
where E: Debug + EventStore,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<E: EventStore> Default for DebugAwareEventStore<E>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<E: EventStore> EventStore for DebugAwareEventStore<E>

Source§

const ENABLED: bool = true

Source§

fn append(&mut self, event: NetEvent)

Source§

fn events(&self) -> &[NetEvent]

Source§

fn size(&self) -> usize

Source§

fn is_empty(&self) -> bool

Auto Trait Implementations§

§

impl<E> Freeze for DebugAwareEventStore<E>
where E: Freeze,

§

impl<E> RefUnwindSafe for DebugAwareEventStore<E>
where E: RefUnwindSafe,

§

impl<E> Send for DebugAwareEventStore<E>

§

impl<E> Sync for DebugAwareEventStore<E>
where E: Sync,

§

impl<E> Unpin for DebugAwareEventStore<E>
where E: Unpin,

§

impl<E> UnsafeUnpin for DebugAwareEventStore<E>
where E: UnsafeUnpin,

§

impl<E> UnwindSafe for DebugAwareEventStore<E>
where E: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.