From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-1.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.3 Received: by atuin.qyliss.net (Postfix, from userid 496) id A89AD1ADA0; Thu, 9 Jul 2020 13:25:09 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 0971D1ACE0; Thu, 9 Jul 2020 13:25:03 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id 2D7B21AD74; Thu, 9 Jul 2020 13:25:01 +0000 (UTC) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by atuin.qyliss.net (Postfix) with ESMTPS id 751D01AD73 for ; Thu, 9 Jul 2020 13:24:57 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id E75CB77A; Thu, 9 Jul 2020 09:24:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 09 Jul 2020 09:24:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h= from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm3; bh=3k8z7t063RndZ4/uYVaN3Yktcq 9mRHlD6g3E9kQ+1L0=; b=fGaPxH9mi2Z/E9mdxWwS/X7wsnmpg67BNrIKwS7iIq FUmZ/Z8nkcq/Y0Mj9/MjF9/oNl1oY6+X0/fMR7g3/IollDbf/CB5zu1VEOm4MbmJ o9V0EON3OCVXTHwWtIwwwlhmE6/tdm5x9OukWEd0SwE2jsA55hYUAxgakAZCDWa6 QoDr3EBjlbDty8IBKxA+64lgAncxoBJf9XGrVcom8sZNNFLqLEbU5f9jb9Q34+4s 0HYfaTCOUthfnVcsQhwY7k9LbNDYlH4CVdQq3FrlP49cfAPIN8A+FAFbeLX/mi9O EhZEemFJxv5WJoRY3iRZAildxcYFGd6k1AHClxJENSZw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=3k8z7t 063RndZ4/uYVaN3Yktcq9mRHlD6g3E9kQ+1L0=; b=s3UAGNtZXouAJUxbMBg+7g jw0icScxA6tC04KVRaZTDsQANlnW0bnPmc9l+x+Ix/UcZa1XuDxAKxqNXTpSh5Hc 2Ytnh7z2YFxvHNS/3WA/+7P93YvIkLCCMZWQzze8Cwqysj+nq+mQIayS9AhtSrOG v7sSnnY3Rxw1IDceFoEy7nMlGZpgiKARLkrSzOTtDxmLzfAjvvu7sqoNuJ0Mw1Zv oA7682nxXNzV/TNRz5xP/OxUwC2qycWAs3Z7Kz+UHJW/owlfpAmYmrpQeZpXUPM5 C6ae6z5Xc1SInFhsNrmMM44Mn07ZMh8K8g9WrTvO8iEGNAfGfvHxXMN7aNK5gAgw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudelgdeihecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffffkgggtsehgtderredttddtnecuhfhrohhmpeetlhihshhsrgcu tfhoshhsuceohhhisegrlhihshhsrgdrihhsqeenucggtffrrghtthgvrhhnpeellefgke fhleehieeuffejhfffgefhleekhfeileeuteevieekkeevieeguefgjeenucffohhmrghi nhepghhithhhuhgsrdgtohhmnecukfhppeekgedrudekgedrvdefgedrudekkeenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehhihesrghlhihs shgrrdhish X-ME-Proxy: Received: from x220.qyliss.net (p54b8eabc.dip0.t-ipconnect.de [84.184.234.188]) by mail.messagingengine.com (Postfix) with ESMTPA id CC3673280060; Thu, 9 Jul 2020 09:24:53 -0400 (EDT) Received: by x220.qyliss.net (Postfix, from userid 1000) id 577DC46B; Thu, 9 Jul 2020 13:24:52 +0000 (UTC) From: Alyssa Ross To: impaqt Subject: Re: [PATCH crosvm 1/2] msg_socket: introduce UnixSeqpacketExt In-Reply-To: References: Date: Thu, 09 Jul 2020 13:24:49 +0000 Message-ID: <87v9iw3joe.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Message-ID-Hash: YW3A2HNFMFCYTWH7UXTPFISPS3M2MFST X-Message-ID-Hash: YW3A2HNFMFCYTWH7UXTPFISPS3M2MFST X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Cole Helbling , devel@spectrum-os.org X-Mailman-Version: 3.3.1 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable "impaqt" writes: >> (3) Make each each VmRequest case a newtype, like so: >> >> #[derive(MsgOnSocket, Debug)] >> pub enum VmRequest { >> Exit(Exit), >> Suspend(Suspend), >> ... >> } >>=20=20=20=20=20 >> 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. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEH9wgcxqlHM/ARR3h+dvtSFmyccAFAl8HGqEACgkQ+dvtSFmy ccAgow/7B8JQlYI3WnJtqNys99aVFNSDJiX/o5j1ukWLW1q4pC6TB//W+5XJA917 +TeVdMi3COq485Y22dQDis/3jjAZ8WBxzRGYv7lXagI8udamUpXtCu27JaL6CCXQ EblJ7OFnugkqvexOh4CXHlAmDEIipWRC2PMjxRs2yWT36U/48RwaIIjH5JVGXNM0 GcllA8kykr+GhlFG58JLsgvELnyAyovp2CjGk1RajSUIGkzNTyEWibHIJn7MrvCw 2t4ZKEd88QOXhJ1h9iUuo2YCERHGseZ4ehMqLOOl4VPlk0TV/OvaN/RnbAMLhTWO p8dmvE78SMotj+57C0pIMqp+rsDouKGQuxRm6qaDd8SjnwudBGDaoYZSK25eY3yQ 4VexftItqaLvuZ8urJ5DzVw7Xf22fWU6eWbRxej4BhUaXqIWTei5Z32nGeFE2H7d cznUe4x4eJorhMcrII9cVDbxnbMZ/fibxGk9xo+dhOM/2IMcCZLyzluJYMR8jm7O Y0E2Sv7B6yP0U7PekBgxIs3krqFkflkiGxBlYfRm0PuP1vk81MHe8regxExIfyJt POfFiX5ny1696d0LK3P0ejCJFMFxCeMkW5LO6Y3YKjeBpISroRIwD581UKAtSeb0 /a8Q7RQ7920KhddAUt5bIhAIGsCFoSdy0vLf3Jldmaxi9EfrEQg= =zI34 -----END PGP SIGNATURE----- --=-=-=--