pub struct HandlerRegistry { /* private fields */ }Expand description
Registry of all handlers for the cell-based server.
Collects registrations from inventory at construction time and provides O(1) lookup by type/id.
Implementations§
Source§impl HandlerRegistry
impl HandlerRegistry
Sourcepub fn new() -> HandlerRegistry
pub fn new() -> HandlerRegistry
Create a new handler registry by collecting all registrations from inventory.
Sourcepub fn get_item_parser(
&self,
entity_type: &str,
) -> Option<fn(Value) -> Result<Arc<dyn AnyItem>, Error>>
pub fn get_item_parser( &self, entity_type: &str, ) -> Option<fn(Value) -> Result<Arc<dyn AnyItem>, Error>>
Get an item parse function by entity type name.
Sourcepub fn get_item_buffer_policy(&self, entity_type: &str) -> IngestBufferPolicy
pub fn get_item_buffer_policy(&self, entity_type: &str) -> IngestBufferPolicy
Get the ingest buffering policy for an entity type.
Sourcepub fn get_query(&self, query_id: &str) -> Option<&StoredQueryData>
pub fn get_query(&self, query_id: &str) -> Option<&StoredQueryData>
Get query registration data by query id.
Sourcepub fn get_report(&self, report_id: &str) -> Option<&StoredReportData>
pub fn get_report(&self, report_id: &str) -> Option<&StoredReportData>
Get report registration data by report id.
Sourcepub fn get_view(&self, view_id: &str) -> Option<&StoredViewData>
pub fn get_view(&self, view_id: &str) -> Option<&StoredViewData>
Get view registration data by view id.
Sourcepub fn has_item_parser(&self, entity_type: &str) -> bool
pub fn has_item_parser(&self, entity_type: &str) -> bool
Check if an entity type has a registered parser.
Sourcepub fn entity_types(&self) -> impl Iterator<Item = &Arc<str>>
pub fn entity_types(&self) -> impl Iterator<Item = &Arc<str>>
Get all registered entity type names.
Sourcepub fn report_ids(&self) -> impl Iterator<Item = &Arc<str>>
pub fn report_ids(&self) -> impl Iterator<Item = &Arc<str>>
Get all registered report ids.
Trait Implementations§
Source§impl Default for HandlerRegistry
impl Default for HandlerRegistry
Source§fn default() -> HandlerRegistry
fn default() -> HandlerRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HandlerRegistry
impl RefUnwindSafe for HandlerRegistry
impl Send for HandlerRegistry
impl Sync for HandlerRegistry
impl Unpin for HandlerRegistry
impl UnsafeUnpin for HandlerRegistry
impl UnwindSafe for HandlerRegistry
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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