I don't really understand why the size is that high.
The size of the `Message` struct is 2416.
The channel is a message in an unsafecell + 1 atomicU8 and 2 atomic bools.
It should only 3 more bytes but for some reason it's 16
The Backend, Dispatch, ExtensionImpl and ExtensionDispatch traits don’t
need to have the platform as a type parameter P. It is sufficient if
the request handling methods receive it as a type parameter. This makes
it easier to implement the traits.
Instead of having different methods to build a client from a generic
Syscall implementation, a &mut Service or a Service, introduce a
two-step process: firstly allocating the endpoint and the interchange
using a &mut Service; secondly creating the client using a Syscall
implementation.
This patch adds API extensions to Trussed. To avoid having to add a
type parameter to Request and Reply, we serialize the requests and
replies. Extensions can be implemented by custom backends and are
executed by the dispatch implementation provided to the Service. An
additional type parameter is needed for ClientImplementation to express
the supported extensions. See tests/ext.rs for an example
implementation.
The serialization and deserialization of the requests and replies of
course adds additional overhead. An alternative would be to make
Request and Reply generic over the set of extensions.
This patch allows backends to store per-client context. The
ClientContext struct is replaced by a Context struct that has two
fields: the context used by the standard Trussed implementation, and the
backend-specific context.
This ensures that `PollClient::request` always matches the correct Request and Reply
This patch also fixes https://github.com/trussed-dev/trussed/issues/84 and replaces the
`From` that used `unreachable_unchecked` with `TryFrom`.
This patch adds a check to FilesystemClient that makes sure that clients
cannot read out files that belong to other clients or that are not in
the data directory for the client. To keep the check simple, we
completely forbid `..` in paths.
This is a breaking change as the Error enum is extended.
Fixes https://github.com/trussed-dev/trussed/issues/65
This patch simplifies ServiceResources::reply_to by moving the store
construction into separate methods. This will also make it possible for
custom backends to easily access the stores.
clippy currently complains about missing safety docs. This is not
trivial to fix because documentation is still sparse within Trussed, but
we want to ignore this for the time being to be able to use clippy in
the CI.
We can trigger the syscall as soon as we placed the request in the
interchange. Doing that directly in PollClient::request instead of
calling PollClient::syscall afterwards makes the code a lot simpler.
The syscalls ReadDirFirst, ReadDirNext, ReadDirFilesFirst,
ReadDirFilesNext implement Trussed-based filesystem traversal. The
"cursor" is however kept in two quasi-global variables, so concurrent
walks interfere with each other. Move these two cursor variables into
the new ClientContext struct instead.
Fixes https://github.com/trussed-dev/trussed/issues/64
The service module uses ClientContext to carry client-specific metadata.
Previously, this was only the ID string, so a type alias for PathBuf was
sufficient. With the new ClientContext struct, we can keep track of
additional metadata like the state of state-ful syscalls.