refactor(lib): keep the actors inside the crate and mark the growing enums

Every release since 14 has been a major, because the actor mailboxes,
the share index's struct and the CLI's command enum were all exhaustive
public API: adding a peer message, a scanned field or a subcommand read
as a breaking change to the library. The actors, dispatcher, peer
plumbing and download store are how the client is built, not what a host
programs against, so they move inside the crate; PeerMessage, SharedFile
and the CLI command enums are non-exhaustive; ConnectionType is
re-exported at the root for the one thing hosts used it for. A one-time
break so that the next additions are not.
This commit is contained in:
Michel de Graaf
2026-09-08 01:45:02 +02:00
parent f6423a2ed6
commit 07dd163156
7 changed files with 26 additions and 12 deletions
+6
View File
@@ -172,7 +172,11 @@ pub struct Cli {
pub log_file: Option<PathBuf>,
}
/// Non-exhaustive: this enum is public through the crate's library target so
/// the integration tests can reach it, and a new subcommand must not read as a
/// breaking change of that library.
#[derive(Subcommand, Debug)]
#[non_exhaustive]
pub enum Commands {
/// Search the network and print matching files
Search(SearchArgs),
@@ -254,6 +258,7 @@ pub struct DaemonArgs {
}
#[derive(Subcommand, Debug)]
#[non_exhaustive]
pub enum DaemonCommand {
/// Print the token remote clients authenticate with
Token,
@@ -266,6 +271,7 @@ pub enum DaemonCommand {
}
#[derive(Subcommand, Debug)]
#[non_exhaustive]
pub enum CompletionsCommand {
/// Write the completion script where the shell looks for it
Install(CompletionsArgs),