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:
@@ -52,7 +52,7 @@ impl<M: Send> ActorHandle<M> {
|
||||
}
|
||||
|
||||
/// Internal actor message wrapper
|
||||
pub(crate) enum ActorMessage<M> {
|
||||
pub enum ActorMessage<M> {
|
||||
UserMessage(M),
|
||||
Stop,
|
||||
}
|
||||
|
||||
@@ -21,7 +21,9 @@ use std::sync::mpsc::{Receiver, Sender};
|
||||
use std::sync::{Arc, RwLock};
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
/// Marked non-exhaustive: each peer message the client learns adds a variant.
|
||||
#[derive(Debug, Clone)]
|
||||
#[non_exhaustive]
|
||||
pub enum PeerMessage {
|
||||
SendMessage(Message),
|
||||
FileSearchResult(SearchResult),
|
||||
|
||||
Reference in New Issue
Block a user