Skip to main content

Handler

Trait Handler 

Source
pub trait Handler {
    type Error: Display;

    // Provided methods
    fn notified(&mut self, channels: ChannelSet) -> Result<(), Self::Error> { ... }
    fn protected(
        &mut self,
        channel: Channel,
        msg_info: MessageInfo,
    ) -> Result<MessageInfo, Self::Error> { ... }
    fn fault(
        &mut self,
        child: Child,
        msg_info: MessageInfo,
    ) -> Result<Option<MessageInfo>, Self::Error> { ... }
    fn take_deferred_action(&mut self) -> Option<DeferredAction> { ... }
}
Expand description

Trait for the application-specific part of a protection domain’s main loop.

Required Associated Types§

Source

type Error: Display

Error type returned by this protection domain’s entrypoints.

Provided Methods§

Source

fn notified(&mut self, channels: ChannelSet) -> Result<(), Self::Error>

This method has the same meaning and type as its analog in libmicrokit.

The default implementation just panics.

Source

fn protected( &mut self, channel: Channel, msg_info: MessageInfo, ) -> Result<MessageInfo, Self::Error>

This method has the same meaning and type as its analog in libmicrokit.

The default implementation just panics.

Source

fn fault( &mut self, child: Child, msg_info: MessageInfo, ) -> Result<Option<MessageInfo>, Self::Error>

This method has the same meaning and type as its analog in libmicrokit.

The default implementation just panics.

Source

fn take_deferred_action(&mut self) -> Option<DeferredAction>

An advanced feature for use by protection domains which seek to coalesce syscalls when possible.

This method is used by the main loop to fuse a queued seL4_Send call with the next seL4_Recv using seL4_NBSendRecv. Its default implementation just returns None.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Handler for !

Source§

type Error = !

Source§

impl<T> Handler for Box<T>
where T: Handler + ?Sized,

Available on crate feature alloc only.
Source§

type Error = <T as Handler>::Error

Source§

fn notified( &mut self, channels: ChannelSet, ) -> Result<(), <Box<T> as Handler>::Error>

Source§

fn protected( &mut self, channel: Channel, msg_info: MessageInfo, ) -> Result<MessageInfo, <Box<T> as Handler>::Error>

Source§

fn fault( &mut self, child: Child, msg_info: MessageInfo, ) -> Result<Option<MessageInfo>, <Box<T> as Handler>::Error>

Source§

fn take_deferred_action(&mut self) -> Option<DeferredAction>

Implementors§