feat(lib): reserve client minor versions 1 (unidentified) and 2 (reference client)
Document the minor-version registry on ClientVersion: within the soulseek-rs major (176), minor 1 stays the library default for unidentified consumers and minor 2 is now the reference CLI/TUI client. Downstream clients reserve their own minor via issue #12.
This commit is contained in:
@@ -171,8 +171,9 @@ pub struct ClientSettings {
|
|||||||
/// Empty means nothing is shared.
|
/// Empty means nothing is shared.
|
||||||
pub shared_directories: Vec<String>,
|
pub shared_directories: Vec<String>,
|
||||||
/// The version reported to the server on login. Defaults to the
|
/// The version reported to the server on login. Defaults to the
|
||||||
/// soulseek-rs major version with minor version 1; clients and bots built
|
/// soulseek-rs major version with minor version 1 ("unidentified");
|
||||||
/// on this library should pick their own minor version.
|
/// clients and bots built on this library should reserve their own minor
|
||||||
|
/// version (see [`ClientVersion`]).
|
||||||
pub version: ClientVersion,
|
pub version: ClientVersion,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,18 @@ pub struct File {
|
|||||||
/// Major versions identify client projects on the Soulseek network and are
|
/// Major versions identify client projects on the Soulseek network and are
|
||||||
/// reserved per project for the project's lifetime:
|
/// reserved per project for the project's lifetime:
|
||||||
/// <https://nicotine-plus.org/doc/SLSKPROTOCOL.html#major-versions>.
|
/// <https://nicotine-plus.org/doc/SLSKPROTOCOL.html#major-versions>.
|
||||||
|
///
|
||||||
|
/// Within the soulseek-rs major, minor versions identify the individual
|
||||||
|
/// clients built on this library. Reserved minors:
|
||||||
|
///
|
||||||
|
/// | Minor | Client |
|
||||||
|
/// |-------|-----------------------------------------------|
|
||||||
|
/// | 1 | unidentified (library default) |
|
||||||
|
/// | 2 | soulseek-rs reference client (CLI/TUI) |
|
||||||
|
///
|
||||||
|
/// Building on this library? Keep [`ClientVersion::MAJOR`] and pick an
|
||||||
|
/// unused minor for your client by opening an issue:
|
||||||
|
/// <https://github.com/michel/soulseek-rs/issues/12>.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
pub struct ClientVersion {
|
pub struct ClientVersion {
|
||||||
pub major: u32,
|
pub major: u32,
|
||||||
@@ -23,14 +35,14 @@ pub struct ClientVersion {
|
|||||||
|
|
||||||
impl ClientVersion {
|
impl ClientVersion {
|
||||||
/// The major version reserved for the soulseek-rs project. Clients and
|
/// The major version reserved for the soulseek-rs project. Clients and
|
||||||
/// bots built on this library keep this major and pick their own non-zero
|
/// bots built on this library keep this major and pick their own
|
||||||
/// minor version.
|
/// reserved minor version (see the table on [`ClientVersion`]).
|
||||||
pub const MAJOR: u32 = 176;
|
pub const MAJOR: u32 = 176;
|
||||||
|
|
||||||
/// The version the soulseek-rs reference client (CLI/TUI) logs in with.
|
/// The version the soulseek-rs reference client (CLI/TUI) logs in with.
|
||||||
pub const REFERENCE_CLIENT: Self = Self {
|
pub const REFERENCE_CLIENT: Self = Self {
|
||||||
major: Self::MAJOR,
|
major: Self::MAJOR,
|
||||||
minor: 100,
|
minor: 2,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user