AlloraRuntime

Struct AlloraRuntime 

Source
pub struct AlloraRuntime { /* private fields */ }
Expand description

Aggregated runtime container for all built components (channels today, more later).

Prefer borrowing via the accessor methods (channels(), channel_by_id) for read-only operations. Use into_channels() only when you need ownership transfer (e.g. embedding channels into another structure or performing manual lifecycle management).

Implementations§

Source§

impl AlloraRuntime

Source

pub fn new(channels: Vec<Box<dyn Channel>>) -> Self

Create a new runtime instance from a vector of channels.

Typically, invoked internally by the DSL (build_runtime_from_str).

Source

pub fn with_filters(self, filters: Vec<Filter>) -> Self

Sets the filters for this runtime.

Consumes the provided filters vector and assigns it to the runtime.

Source

pub fn with_services(self, services: Vec<ServiceProcessor>) -> Self

Sets the services for this runtime.

Consumes the provided services vector and assigns it to the runtime.

Source

pub fn with_service_processors( self, proc: Vec<ServiceActivatorProcessor>, ) -> Self

Source

pub fn with_http_inbound_adapters( self, adapters: Vec<HttpInboundAdapter>, ) -> Self

Sets the HTTP inbound adapters for this runtime.

Consumes the provided adapters vector and assigns it to the runtime.

Source

pub fn with_http_outbound_adapters( self, adapters: Vec<HttpOutboundAdapter>, ) -> Self

Source

pub fn channels(&self) -> impl Iterator<Item = &dyn Channel>

Borrow all channels as an iterator of &dyn Channel (zero allocation).

Source

pub fn channels_slice(&self) -> &[Arc<dyn Channel>]

Borrow underlying boxed channel slice (rarely needed).

Source

pub fn filters(&self) -> &[Filter]

Borrow all filters (read-only slice).

Source

pub fn services(&self) -> &[ServiceProcessor]

Borrow all services (read-only slice).

Source

pub fn into_channels(self) -> Vec<Arc<dyn Channel>>

Consume the runtime, yielding owned channels.

Source

pub fn into_filters(self) -> Vec<Filter>

Consume the runtime, yielding owned filters.

Source

pub fn into_services(self) -> Vec<ServiceProcessor>

Consume the runtime, yielding owned services.

Source

pub fn channel_by_id(&self, id: &str) -> Option<&dyn Channel>

Find a channel by its id; returns None if not present.

Complexity: O(n). Optimizations (hash index) can be added later without changing this method’s signature or semantics.

Source

pub fn channel_ref_by_id(&self, id: &str) -> Option<Arc<dyn Channel>>

Return a cloned Arc by id if it exists (helper for builders needing ownership).

Source

pub fn channel_typed<T: Channel + 'static>(&self, id: &str) -> Option<&T>

Generic typed channel lookup: returns &T if a channel with id exists and downcasts to T.

Source

pub fn channel<T: Channel + 'static>(&self, id: &str) -> &T

Required typed channel lookup: panics with a clear message if missing or wrong type.

Source

pub fn channel_is<T: Channel + 'static>(&self, id: &str) -> bool

Predicate: does channel id exist and is of type T?

Source

pub fn channel_count(&self) -> usize

Total number of channels in this runtime.

Source

pub fn filter_count(&self) -> usize

Total number of filters in this runtime.

Source

pub fn service_count(&self) -> usize

Total number of services in this runtime.

Source

pub fn service_processor_count(&self) -> usize

Total number of service processors in this runtime.

Source

pub fn service_activator_processors(&self) -> &[ServiceActivatorProcessor]

Source

pub fn service_activator_processor_by_id( &self, id: &str, ) -> Option<&ServiceActivatorProcessor>

Source

pub fn service_activator_processor_mut_by_id( &mut self, id: &str, ) -> Option<&mut ServiceActivatorProcessor>

Source

pub fn http_inbound_adapters(&self) -> &[HttpInboundAdapter]

Source

pub fn http_inbound_adapter_count(&self) -> usize

Source

pub fn http_outbound_adapters(&self) -> &[HttpOutboundAdapter]

Source

pub fn http_outbound_adapter_count(&self) -> usize

Trait Implementations§

Source§

impl Debug for AlloraRuntime

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more