Crate server

Crate server 

Source
Expand description

A type-safe way to implement KeyOS servers.

Re-exports§

pub use xous;
pub use xous_ipc;
pub use xous_names;

Modules§

rkyv_with
Custom rkyv serialization helpers for KeyOS

Macros§

wrapped_scalar

Structs§

AllPermissions
ArchiveEventSubscriber
Handle for a single event subscriber
ArchiveRequest
archive request with deferred response capability
ArchiveResponse
deferred response that sends default on drop if not used
ArchiveSubList
ArchivedAsyncMessageInit
An archived AsyncMessageInit
ArchivedEventSubscriptionMessage
An archived EventSubscriptionMessage
AsyncMessageInit
AsyncMessageInitResolver
The resolver for an archived AsyncMessageInit
BlockingScalarRequest
scalar request with deferred response capability
BlockingScalarResponse
deferred response that sends default on drop if not used
CheckedConn
A typed connection to a running KeyOS server.
DeferredLendMut
An encapsulated blocking LendMut message, which can be responded to later during execution. It can be stored, and will return the message when dropped, or the DeferredLendMut::set_response function is called.
EventSubscriptionMessage
EventSubscriptionMessageResolver
The resolver for an archived EventSubscriptionMessage
Owned
ScalarEventSubscriber
Handle for a single event subscriber
ScalarSubList
A list of scalar event subscribers.
ServerContext
Handle representing the running server instance
SimpleMemoryMessage
An easier to use version of [xous::MemoryMessage]
WithAllPermissions

Enums§

Error
Infallible
An error type that can never be constructed, similar to std::convert::Infallible but with rkyv serialization support.

Traits§

Archive
A message which can be serialized and deserialized using rkyv, with no response.
ArchiveCodec
serialization requirements for archive messages
ArchiveEvent
A message which can be serialized and deserialized using rkyv.
ArchiveEventHandler
Handler for an incoming ArchiveEvent
ArchiveEventSubscriptionHandler
ArchiveHandler
A Archive message handler.
ArchiveResponseHandler
handle async responses from other servers
ArchiveSubscription
AsScalar
BlockingArchive
heap allocated message that expects a response
BlockingArchiveAsyncHandler
handle archive messages asynchronously (can defer response)
BlockingArchiveHandler
handle archive messages synchronously
BlockingScalar
stack allocated message that expects a response
BlockingScalarAsyncHandler
handle scalar messages asynchronously (can defer response)
BlockingScalarHandler
handle scalar messages synchronously
BlockingScalarResponseHandler
handle async responses from other servers
CheckedPermissions
Marker trait for the server name and compile-time permissions attached to a connection.
DeferredLendMutHandler
An DeferredLendMut message handler that can defer the response
FromScalar
LendMut
A message which is simply some mutably borrowed memory.
LendMutHandler
A LendMut message handler.
LendMutResponse
MessageAllowed
Compile-time proof that permissions type P may send message M.
MessageId
Move
A message which is simply a to-be-sent memory range
MoveHandler
A Move message handler.
Scalar
stack allocated message with no response
ScalarCodec
encoding requirements for scalar messages
ScalarEvent
A message which can be serialized and deserialized using scalar encoding.
ScalarEventHandler
Handler for an incoming ScalarEvent
ScalarEventSubscriptionHandler
A ScalarSubscription handler.
ScalarHandler
handle fire-and-forget scalar messages
ScalarSubscription
Server
A server.
ServerMessages
This trait contains the actual message definitions that the server can handle. It should not be used manually, but via the #[derive(server::Server)] macro.
SubscriptionError

Functions§

create_sid
decode_archive_async_response
decode async response from raw envelope
decode_archive_event
decode_scalar_async_response
decode async response from raw envelope
decode_scalar_event
extract_cancellation_message
handle_archive_message
Message handler, used by ServerMessages::messages()
handle_archive_subscription
Message handler, used by ServerMessages::messages()
handle_blocking_archive_message
Message handler, used by ServerMessages::messages()
handle_blocking_scalar_message
Message handler, used by ServerMessages::messages()
handle_deferred_lend_mut
Message handler, used by ServerMessages::messages()
handle_lend_mut
Message handler, used by ServerMessages::messages()
handle_move
Message handler, used by ServerMessages::messages()
handle_scalar_message
Message handler, used by ServerMessages::messages()
handle_scalar_subscription
Message handler, used by ServerMessages::messages()
lend_mut
Send a LendMut message.
listen
Start the main loop of the server, where messages will be handled as they come in.
listen_and_connect
Start a server in a background thread and open a connection to it.
listen_with
send_archive
Send a Archive message. Blocks if the queue is full. Cannot be used from an IRQ context.
send_archive_nowait
Try to send a Archive message. Returns an error if the queue is full Can be used from an IRQ context.
send_blocking_archive
send archive message and block for response
send_blocking_scalar
send scalar message and block for response
send_move
Send a Move message (panics on failure)
send_move_nowait
Try sending a Move message. Does not block if the message queue is full. Can be used in an IRQ handler.
send_scalar
Send a Scalar message. Blocks if queues are full.
send_scalar_async
send scalar message without blocking returns the [xous::MessageId] used for the reply
send_scalar_nowait
Try sending a Scalar message, return error if the syscall queue is full. Can be used in an IRQ handler.
subscribe_archive
Subscribe to an ArchiveEvent event.
subscribe_scalar
Subscribe to a ScalarEvent event.
try_decode_archive_async_response
try_decode_archive_event
try_decode_scalar_async_response
try to decode async response from raw envelope, returns error instead of panic
try_decode_scalar_event
try_send_blocking_archive
send archive message, returns error instead of panic
try_send_blocking_scalar
send scalar message, returns error instead of panic
try_send_move
Send a Move message (fallible)
try_send_scalar
Send a Scalar message. Blocks if queues are full.
try_send_scalar_async
send async scalar message, returns error instead of panic returns the [xous::MessageId] used for the reply
try_subscribe_archive
try_subscribe_scalar

Type Aliases§

MessageDef
A message that is known to be handled by a server. This is the type returned by the server message registration helpers.

Derive Macros§

Message
Permissions
Server