Struct DispatcherBuilder
pub struct DispatcherBuilder {
routes: Vec<Route>,
config: DispatcherConfig,
k2k_config: K2KConfig,
}Expand description
Builder for creating a KernelDispatcher.
Fields§
§routes: Vec<Route>§config: DispatcherConfig§k2k_config: K2KConfigImplementations§
§impl DispatcherBuilder
impl DispatcherBuilder
pub fn new() -> DispatcherBuilder
pub fn new() -> DispatcherBuilder
Create a new builder.
pub fn route<M>(self, kernel_id: KernelId) -> DispatcherBuilderwhere
M: PersistentMessage,
pub fn route<M>(self, kernel_id: KernelId) -> DispatcherBuilderwhere
M: PersistentMessage,
Add a route for a PersistentMessage type.
pub fn route_named<M>(
self,
kernel_id: KernelId,
handler_name: &str,
) -> DispatcherBuilderwhere
M: PersistentMessage,
pub fn route_named<M>(
self,
kernel_id: KernelId,
handler_name: &str,
) -> DispatcherBuilderwhere
M: PersistentMessage,
Add a route with custom handler name.
pub fn route_raw(self, type_id: u64, kernel_id: KernelId) -> DispatcherBuilder
pub fn route_raw(self, type_id: u64, kernel_id: KernelId) -> DispatcherBuilder
Add a raw route (for dynamic type_ids).
pub fn with_config(self, config: DispatcherConfig) -> DispatcherBuilder
pub fn with_config(self, config: DispatcherConfig) -> DispatcherBuilder
Set dispatcher configuration.
pub fn with_k2k_config(self, config: K2KConfig) -> DispatcherBuilder
pub fn with_k2k_config(self, config: K2KConfig) -> DispatcherBuilder
Set K2K configuration.
pub fn with_logging(self) -> DispatcherBuilder
pub fn with_logging(self) -> DispatcherBuilder
Enable logging.
pub fn with_priority(self, priority: u8) -> DispatcherBuilder
pub fn with_priority(self, priority: u8) -> DispatcherBuilder
Set default message priority.
pub fn build(self) -> KernelDispatcher
pub fn build(self) -> KernelDispatcher
Build the dispatcher with a new K2K broker.
pub fn build_with_broker(self, broker: Arc<K2KBroker>) -> KernelDispatcher
pub fn build_with_broker(self, broker: Arc<K2KBroker>) -> KernelDispatcher
Build the dispatcher with an existing K2K broker.
Trait Implementations§
§impl Default for DispatcherBuilder
impl Default for DispatcherBuilder
§fn default() -> DispatcherBuilder
fn default() -> DispatcherBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DispatcherBuilder
impl RefUnwindSafe for DispatcherBuilder
impl Send for DispatcherBuilder
impl Sync for DispatcherBuilder
impl Unpin for DispatcherBuilder
impl UnwindSafe for DispatcherBuilder
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.