Struct DispatchTable
pub struct DispatchTable {
handlers: Vec<HandlerRegistration>,
max_handler_id: u32,
}Expand description
Dispatch table mapping handler IDs to functions.
Used during code generation to build the CUDA switch statement.
Fields§
§handlers: Vec<HandlerRegistration>§max_handler_id: u32Implementations§
§impl DispatchTable
impl DispatchTable
pub fn new() -> DispatchTable
pub fn new() -> DispatchTable
Create a new empty dispatch table.
pub fn register(
&mut self,
registration: HandlerRegistration,
) -> Result<(), RingKernelError>
pub fn register( &mut self, registration: HandlerRegistration, ) -> Result<(), RingKernelError>
Register a handler.
Returns an error if a handler with the same ID is already registered.
pub fn register_message<M>(
&mut self,
name: impl Into<String>,
) -> Result<(), RingKernelError>where
M: PersistentMessage,
pub fn register_message<M>(
&mut self,
name: impl Into<String>,
) -> Result<(), RingKernelError>where
M: PersistentMessage,
Register a handler from a PersistentMessage type.
pub fn handlers(&self) -> &[HandlerRegistration]
pub fn handlers(&self) -> &[HandlerRegistration]
Get all registered handlers.
pub fn get(&self, handler_id: u32) -> Option<&HandlerRegistration>
pub fn get(&self, handler_id: u32) -> Option<&HandlerRegistration>
Get a handler by ID.
pub fn max_handler_id(&self) -> u32
pub fn max_handler_id(&self) -> u32
Get the maximum handler ID.
Trait Implementations§
§impl Clone for DispatchTable
impl Clone for DispatchTable
§fn clone(&self) -> DispatchTable
fn clone(&self) -> DispatchTable
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for DispatchTable
impl Debug for DispatchTable
§impl Default for DispatchTable
impl Default for DispatchTable
§fn default() -> DispatchTable
fn default() -> DispatchTable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DispatchTable
impl RefUnwindSafe for DispatchTable
impl Send for DispatchTable
impl Sync for DispatchTable
impl Unpin for DispatchTable
impl UnwindSafe for DispatchTable
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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.