Byte Engine Docs
View on docs.rs

message_observer

Generated Rust API reference for byte_engine.

byte_engine / core / message_observer


Module message_observer

Passive diagnostics for publications and factory-created objects.

Attach one MessageObserver through crate::core::message_bus::MessageBus::observe. Publication ranges come from the bus's existing route counters, so producers do no extra work. Ranges preserve sequence within one route, not ordering between routes. Factory hooks retain handles and Rust type names, never message payloads or created values.

Quick Reference

ItemKindDescription
MessageObservationstructThe MessageObservation struct identifies a contiguous range of successful publications without retaining payloads.
MessageObservationBatchstructThe MessageObservationBatch struct carries one lossless snapshot of publication ranges since the prior drain.
ObservedEntitystructThe ObservedEntity struct describes one factory handle and every representation created for it.
MessageObserverstructThe MessageObserver struct provides passive publication ranges and a factory-backed entity catalog.
MessageObservationErrorenumThe MessageObservationError enum explains why passive observation could not start.

Structs

MessageObservation

struct MessageObservation {
    // [REDACTED: Private Fields]
}

Defined in crates/byte-engine/src/core/message_observer.rs:52-56

The MessageObservation struct identifies a contiguous range of successful publications without retaining payloads.

Implementations

  • fn topic_id(self) -> usize

    Returns the stable bus-local route identifier used by topic diagnostics.

  • fn first_sequence(self) -> u64

    Returns the first zero-based publication sequence in this range.

  • fn count(self) -> u64

    Returns the number of consecutive publications in this range.

Trait Implementations

impl ArchivePointee for MessageObservation
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for MessageObservation
impl Clone for MessageObservation
impl Copy for MessageObservation
impl Debug for MessageObservation
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for MessageObservation
  • fn into_any(self: Box<T>) -> Box<dyn Any>
  • fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
  • fn as_any(&self) -> &dyn Any
  • fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSend for MessageObservation
  • fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>
impl DowncastSync for MessageObservation
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>
impl Eq for MessageObservation
impl<K> Equivalent for MessageObservation
  • fn equivalent(&self, key: &K) -> bool
impl Instrument for MessageObservation
impl LayoutRaw for MessageObservation
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for MessageObservation
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for MessageObservation
impl Pointable for MessageObservation
  • const ALIGN: usize
  • type Init = T
  • unsafe fn init(init: <T as Pointable>::Init) -> usize
  • unsafe fn deref<'a>(ptr: usize) -> &'a T
  • unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
  • unsafe fn drop(ptr: usize)
impl Pointee for MessageObservation
  • type Metadata = ()
impl Read for MessageObservation
impl StructuralPartialEq for MessageObservation
impl WithSubscriber for MessageObservation

MessageObservationBatch

struct MessageObservationBatch {
    // [REDACTED: Private Fields]
}

Defined in crates/byte-engine/src/core/message_observer.rs:77-79

The MessageObservationBatch struct carries one lossless snapshot of publication ranges since the prior drain.

Implementations

  • fn messages(&self) -> &[MessageObservation]

    Related: MessageObservation

    Returns one range for each route that published since the prior drain.

Trait Implementations

impl ArchivePointee for MessageObservationBatch
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for MessageObservationBatch
impl Debug for MessageObservationBatch
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for MessageObservationBatch
  • fn into_any(self: Box<T>) -> Box<dyn Any>
  • fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
  • fn as_any(&self) -> &dyn Any
  • fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSend for MessageObservationBatch
  • fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>
impl DowncastSync for MessageObservationBatch
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>
impl Eq for MessageObservationBatch
impl<K> Equivalent for MessageObservationBatch
  • fn equivalent(&self, key: &K) -> bool
impl Instrument for MessageObservationBatch
impl LayoutRaw for MessageObservationBatch
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for MessageObservationBatch
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for MessageObservationBatch
impl Pointable for MessageObservationBatch
  • const ALIGN: usize
  • type Init = T
  • unsafe fn init(init: <T as Pointable>::Init) -> usize
  • unsafe fn deref<'a>(ptr: usize) -> &'a T
  • unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
  • unsafe fn drop(ptr: usize)
impl Pointee for MessageObservationBatch
  • type Metadata = ()
impl Read for MessageObservationBatch
impl StructuralPartialEq for MessageObservationBatch
impl WithSubscriber for MessageObservationBatch

ObservedEntity

struct ObservedEntity {
    // [REDACTED: Private Fields]
}

Defined in crates/byte-engine/src/core/message_observer.rs:90-93

The ObservedEntity struct describes one factory handle and every representation created for it.

Implementations

  • fn handle(&self) -> Handle

    Returns the stable identity shared by the entity's representations.

  • fn types(&self) -> &[&'static str]

    Returns the Rust type names in their first-published order.

Trait Implementations

impl ArchivePointee for ObservedEntity
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for ObservedEntity
impl Clone for ObservedEntity
impl Debug for ObservedEntity
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for ObservedEntity
  • fn into_any(self: Box<T>) -> Box<dyn Any>
  • fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
  • fn as_any(&self) -> &dyn Any
  • fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSend for ObservedEntity
  • fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>
impl DowncastSync for ObservedEntity
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>
impl Eq for ObservedEntity
impl<K> Equivalent for ObservedEntity
  • fn equivalent(&self, key: &K) -> bool
impl Instrument for ObservedEntity
impl LayoutRaw for ObservedEntity
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for ObservedEntity
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for ObservedEntity
  • fn eq(&self, other: &ObservedEntity) -> bool

    Related: ObservedEntity

impl Pointable for ObservedEntity
  • const ALIGN: usize
  • type Init = T
  • unsafe fn init(init: <T as Pointable>::Init) -> usize
  • unsafe fn deref<'a>(ptr: usize) -> &'a T
  • unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
  • unsafe fn drop(ptr: usize)
impl Pointee for ObservedEntity
  • type Metadata = ()
impl Read for ObservedEntity
impl StructuralPartialEq for ObservedEntity
impl WithSubscriber for ObservedEntity

MessageObserver

struct MessageObserver {
    // [REDACTED: Private Fields]
}

Defined in crates/byte-engine/src/core/message_observer.rs:113-115

The MessageObserver struct provides passive publication ranges and a factory-backed entity catalog.

Drain publication ranges through Self::drain_messages. Query current factory handles through Self::entities. Neither path retains message payloads or factory-created values.

Implementations

  • fn drain_messages(&self, topics: &[TopicSnapshot]) -> MessageObservationBatch

    Related: TopicSnapshot, MessageObservationBatch

    Returns lossless publication ranges since the prior call for these topic snapshots.

  • fn entities(&self) -> Vec<ObservedEntity>

    Related: ObservedEntity

    Returns a handle-sorted snapshot of every current factory-created entity.

Trait Implementations

impl ArchivePointee for MessageObserver
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for MessageObserver
impl Clone for MessageObserver
impl Downcast for MessageObserver
  • fn into_any(self: Box<T>) -> Box<dyn Any>
  • fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
  • fn as_any(&self) -> &dyn Any
  • fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSend for MessageObserver
  • fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>
impl DowncastSync for MessageObserver
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>
impl Instrument for MessageObserver
impl LayoutRaw for MessageObserver
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for MessageObserver
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointable for MessageObserver
  • const ALIGN: usize
  • type Init = T
  • unsafe fn init(init: <T as Pointable>::Init) -> usize
  • unsafe fn deref<'a>(ptr: usize) -> &'a T
  • unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
  • unsafe fn drop(ptr: usize)
impl Pointee for MessageObserver
  • type Metadata = ()
impl Read for MessageObserver
impl WithSubscriber for MessageObserver

Enums

MessageObservationError

enum MessageObservationError {
    AlreadyAttached,
    RoutesAlreadyRegistered,
}

Defined in crates/byte-engine/src/core/message_observer.rs:26-31

The MessageObservationError enum explains why passive observation could not start.

Variants

  • AlreadyAttached

    This bus already has its one passive observer.

  • RoutesAlreadyRegistered

    At least one typed route was registered before observation started.

Trait Implementations

impl ArchivePointee for MessageObservationError
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for MessageObservationError
impl Clone for MessageObservationError
impl Copy for MessageObservationError
impl Debug for MessageObservationError
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Display for MessageObservationError
  • fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for MessageObservationError
  • fn into_any(self: Box<T>) -> Box<dyn Any>
  • fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
  • fn as_any(&self) -> &dyn Any
  • fn as_any_mut(&mut self) -> &mut dyn Any
impl DowncastSend for MessageObservationError
  • fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>
impl DowncastSync for MessageObservationError
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>
impl Eq for MessageObservationError
impl<K> Equivalent for MessageObservationError
  • fn equivalent(&self, key: &K) -> bool
impl Error for MessageObservationError
impl Instrument for MessageObservationError
impl LayoutRaw for MessageObservationError
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for MessageObservationError
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for MessageObservationError
impl Pointable for MessageObservationError
  • const ALIGN: usize
  • type Init = T
  • unsafe fn init(init: <T as Pointable>::Init) -> usize
  • unsafe fn deref<'a>(ptr: usize) -> &'a T
  • unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
  • unsafe fn drop(ptr: usize)
impl Pointee for MessageObservationError
  • type Metadata = ()
impl Read for MessageObservationError
impl StructuralPartialEq for MessageObservationError
impl ToString for MessageObservationError
  • fn to_string(&self) -> String
impl WithSubscriber for MessageObservationError

On this page

Module message_observerQuick ReferenceStructsMessageObservationImplementationsTrait Implementationsimpl ArchivePointee for MessageObservationimpl<ST> CastableFrom for MessageObservationimpl Clone for MessageObservationimpl Copy for MessageObservationimpl Debug for MessageObservationimpl Downcast for MessageObservationimpl DowncastSend for MessageObservationimpl DowncastSync for MessageObservationimpl Eq for MessageObservationimpl<K> Equivalent for MessageObservationimpl Instrument for MessageObservationimpl LayoutRaw for MessageObservationimpl<T, N1> Niching for MessageObservationimpl PartialEq for MessageObservationimpl Pointable for MessageObservationimpl Pointee for MessageObservationimpl Read for MessageObservationimpl StructuralPartialEq for MessageObservationimpl WithSubscriber for MessageObservationMessageObservationBatchImplementationsTrait Implementationsimpl ArchivePointee for MessageObservationBatchimpl<ST> CastableFrom for MessageObservationBatchimpl Debug for MessageObservationBatchimpl Downcast for MessageObservationBatchimpl DowncastSend for MessageObservationBatchimpl DowncastSync for MessageObservationBatchimpl Eq for MessageObservationBatchimpl<K> Equivalent for MessageObservationBatchimpl Instrument for MessageObservationBatchimpl LayoutRaw for MessageObservationBatchimpl<T, N1> Niching for MessageObservationBatchimpl PartialEq for MessageObservationBatchimpl Pointable for MessageObservationBatchimpl Pointee for MessageObservationBatchimpl Read for MessageObservationBatchimpl StructuralPartialEq for MessageObservationBatchimpl WithSubscriber for MessageObservationBatchObservedEntityImplementationsTrait Implementationsimpl ArchivePointee for ObservedEntityimpl<ST> CastableFrom for ObservedEntityimpl Clone for ObservedEntityimpl Debug for ObservedEntityimpl Downcast for ObservedEntityimpl DowncastSend for ObservedEntityimpl DowncastSync for ObservedEntityimpl Eq for ObservedEntityimpl<K> Equivalent for ObservedEntityimpl Instrument for ObservedEntityimpl LayoutRaw for ObservedEntityimpl<T, N1> Niching for ObservedEntityimpl PartialEq for ObservedEntityimpl Pointable for ObservedEntityimpl Pointee for ObservedEntityimpl Read for ObservedEntityimpl StructuralPartialEq for ObservedEntityimpl WithSubscriber for ObservedEntityMessageObserverImplementationsTrait Implementationsimpl ArchivePointee for MessageObserverimpl<ST> CastableFrom for MessageObserverimpl Clone for MessageObserverimpl Downcast for MessageObserverimpl DowncastSend for MessageObserverimpl DowncastSync for MessageObserverimpl Instrument for MessageObserverimpl LayoutRaw for MessageObserverimpl<T, N1> Niching for MessageObserverimpl Pointable for MessageObserverimpl Pointee for MessageObserverimpl Read for MessageObserverimpl WithSubscriber for MessageObserverEnumsMessageObservationErrorVariantsTrait Implementationsimpl ArchivePointee for MessageObservationErrorimpl<ST> CastableFrom for MessageObservationErrorimpl Clone for MessageObservationErrorimpl Copy for MessageObservationErrorimpl Debug for MessageObservationErrorimpl Display for MessageObservationErrorimpl Downcast for MessageObservationErrorimpl DowncastSend for MessageObservationErrorimpl DowncastSync for MessageObservationErrorimpl Eq for MessageObservationErrorimpl<K> Equivalent for MessageObservationErrorimpl Error for MessageObservationErrorimpl Instrument for MessageObservationErrorimpl LayoutRaw for MessageObservationErrorimpl<T, N1> Niching for MessageObservationErrorimpl PartialEq for MessageObservationErrorimpl Pointable for MessageObservationErrorimpl Pointee for MessageObservationErrorimpl Read for MessageObservationErrorimpl StructuralPartialEq for MessageObservationErrorimpl ToString for MessageObservationErrorimpl WithSubscriber for MessageObservationError