From: Alyssa Ross <hi@alyssa.is>
To: impaqt <impaqt@vendek.net>
Cc: Cole Helbling <cole.e.helbling@outlook.com>, devel@spectrum-os.org
Subject: Re: [PATCH crosvm 1/2] msg_socket: introduce UnixSeqpacketExt
Date: Thu, 09 Jul 2020 13:24:49 +0000 [thread overview]
Message-ID: <87v9iw3joe.fsf@alyssa.is> (raw)
In-Reply-To: <C3PT4E84EP2V.2R7DFPMRN4B3R@jupiter>
[-- Attachment #1: Type: text/plain, Size: 979 bytes --]
"impaqt" <impaqt@vendek.net> writes:
>> (3) Make each each VmRequest case a newtype, like so:
>>
>> #[derive(MsgOnSocket, Debug)]
>> pub enum VmRequest {
>> Exit(Exit),
>> Suspend(Suspend),
>> ...
>> }
>>
>> This would basically be a workaround for the fact that enum variants in
>> Rust aren't proper types. If they were, though (which we can emulate
>> through this approach), we could have some trait with an associated
>> socket type for executing each type of request.
>
> The machine crate might make this option a bit less annoying:
> https://github.com/rust-bakery/machine
That does look good. Feels like a bit of a shame the machine!() macro
isn't its own crate with a more generic name, because I'm sure there are
all sorts of situations in which that's useful. As it is, I'd feel a
bit concerned about depending on a crate about state machines to define
some enums, because that could be very confusing for somebody reading
the code.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2020-07-09 13:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-14 11:43 [PATCH crosvm 0/2] Fix deadlock on early VmRequest Alyssa Ross
2020-06-14 11:43 ` [PATCH crosvm 1/2] msg_socket: introduce UnixSeqpacketExt Alyssa Ross
2020-06-16 0:17 ` Cole Helbling
2020-06-16 9:32 ` Alyssa Ross
2020-06-22 22:06 ` Cole Helbling
2020-06-23 2:32 ` Alyssa Ross
2020-06-25 1:54 ` impaqt
2020-07-09 13:24 ` Alyssa Ross [this message]
2020-06-14 11:43 ` [PATCH crosvm 2/2] crosvm: fix deadlock on early VmRequest Alyssa Ross
2020-06-16 1:08 ` Cole Helbling
2020-06-16 9:39 ` Alyssa Ross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v9iw3joe.fsf@alyssa.is \
--to=hi@alyssa.is \
--cc=cole.e.helbling@outlook.com \
--cc=devel@spectrum-os.org \
--cc=impaqt@vendek.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://spectrum-os.org/git/crosvm
https://spectrum-os.org/git/doc
https://spectrum-os.org/git/mktuntap
https://spectrum-os.org/git/nixpkgs
https://spectrum-os.org/git/spectrum
https://spectrum-os.org/git/ucspi-vsock
https://spectrum-os.org/git/www
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).