Warn about undocumented public items of voelin-ui-vm
#![warn(missing_docs)] on the crate, with the fields and variants that had no docs documented (BBCode styles and spans, settings, the tree's input) and a targeted allow on the two mirror modules, bridge and studio_bridge, whose fields are those of the Slint structs and are explained by the comments in bridge.slint and studio-bridge.slint. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
12b2773791
commit
0672b21758
11 files changed
+61
-2
No files matched your search
@@ -36,9 +36,13 @@ pub const MAX_RUNS: usize = 1500;
|
||||
/// How a span of text looks.
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq)]
|
||||
pub struct Style {
|
||||
/// Bold (`[b]`).
|
||||
pub bold: bool,
|
||||
/// Italic (`[i]`).
|
||||
pub italic: bool,
|
||||
/// Underlined (`[u]`).
|
||||
pub underline: bool,
|
||||
/// Struck through (`[s]`).
|
||||
pub strike: bool,
|
||||
/// Code: on a background.
|
||||
pub code: bool,
|
||||
@@ -51,12 +55,16 @@ pub struct Style {
|
||||
/// A piece of a block.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub enum Span {
|
||||
/// Text with one style.
|
||||
Text {
|
||||
/// The characters.
|
||||
text: String,
|
||||
/// How they look.
|
||||
style: Style,
|
||||
},
|
||||
/// A picture at an address (`[img]…[/img]`).
|
||||
Image {
|
||||
/// Where the picture is.
|
||||
url: String,
|
||||
},
|
||||
}
|
||||
@@ -68,7 +76,10 @@ pub enum BlockKind {
|
||||
Text,
|
||||
/// A line of a quote; the first names who said it (`[quote=Name]`), when
|
||||
/// the quote does.
|
||||
Quote { author: String },
|
||||
Quote {
|
||||
/// Who said it, empty when the quote does not say.
|
||||
author: String,
|
||||
},
|
||||
/// Code: all its lines in one span.
|
||||
Code,
|
||||
/// An item of a list.
|
||||
@@ -80,13 +91,16 @@ pub enum BlockKind {
|
||||
/// A line, a quote's line, code, a list item or a rule.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct Block {
|
||||
/// What the block is.
|
||||
pub kind: BlockKind,
|
||||
/// Its pieces, left to right.
|
||||
pub spans: Vec<Span>,
|
||||
}
|
||||
|
||||
/// A message's text: its blocks, top to bottom.
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq)]
|
||||
pub struct Doc {
|
||||
/// The lines, quotes, code and rules in order.
|
||||
pub blocks: Vec<Block>,
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
//! (`bind/convert.rs`), the GPUI client will render them as they are.
|
||||
//! `MytsBadge` and `MytsForm` (account screens without a data source in this
|
||||
//! build) stay in Slint.
|
||||
//!
|
||||
//! The fields are not documented one by one: they are those of the Slint
|
||||
//! structs, whose comments in `bridge.slint` explain them; the comments that
|
||||
//! are here were carried over with them.
|
||||
#![allow(missing_docs)]
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
|
||||
@@ -24,7 +24,9 @@ const GROUP_MS: i64 = 5 * 60 * 1000;
|
||||
/// The author and time of the line before, for grouping.
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq)]
|
||||
pub struct Previous {
|
||||
/// Who wrote it.
|
||||
pub author: String,
|
||||
/// When, in milliseconds since the epoch.
|
||||
pub ts_ms: i64,
|
||||
}
|
||||
|
||||
|
||||
@@ -298,7 +298,9 @@ pub fn first_key(text: &str) -> Option<String> {
|
||||
/// A piece of text: plain, or one emoji (`emoji` is its key).
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct Run {
|
||||
/// The text: the word with its space, or the emoji's own characters.
|
||||
pub text: String,
|
||||
/// The key of the Twemoji picture, none for plain text.
|
||||
pub emoji: Option<String>,
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,11 @@ pub enum ResumeAction {
|
||||
/// The card: the server, the channel and the button.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct Resume {
|
||||
/// The id of the server's bookmark.
|
||||
pub bookmark: i64,
|
||||
/// The channel's path, its names from the top as the server has them.
|
||||
pub path: Vec<String>,
|
||||
/// What the button does.
|
||||
pub action: ResumeAction,
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
//! Neither Slint nor GPUI is a dependency; each front end converts these
|
||||
//! types (docs/ui.md, "Two crates").
|
||||
|
||||
// Every public item is documented, except the fields of the two mirror
|
||||
// modules (`bridge`, `studio_bridge`): their 400 or so fields are those of
|
||||
// the Slint structs and are explained by the comments in `bridge.slint` and
|
||||
// `studio-bridge.slint`, which stay the one place to read them until the
|
||||
// Slint front end goes.
|
||||
#![warn(missing_docs)]
|
||||
|
||||
pub mod avatar;
|
||||
pub mod bbcode;
|
||||
pub mod bridge;
|
||||
|
||||
@@ -126,6 +126,7 @@ pub fn form(
|
||||
pub struct ConnectTo {
|
||||
/// A channel path, or `/<id>`.
|
||||
pub channel: Option<String>,
|
||||
/// The channel's password, if the form has one.
|
||||
pub channel_password: Option<String>,
|
||||
/// A privilege key.
|
||||
pub token: Option<String>,
|
||||
|
||||
@@ -31,8 +31,10 @@ pub static CLIENT_PLAYBACK: Key<ClientPlaybackMap> = Key::new(
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum ThemeChoice {
|
||||
/// The dark palette.
|
||||
#[default]
|
||||
Dark,
|
||||
/// The light palette.
|
||||
Light,
|
||||
/// The system's light or dark scheme.
|
||||
System,
|
||||
@@ -128,8 +130,11 @@ pub fn appearance_keys() -> [&'static dyn voelin_core::settings::Setting; 6] {
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum NotifyLevel {
|
||||
/// Nothing.
|
||||
Off,
|
||||
/// The bell in the app.
|
||||
App,
|
||||
/// The bell and a desktop notification.
|
||||
#[default]
|
||||
Desktop,
|
||||
}
|
||||
@@ -294,6 +299,7 @@ pub struct UiSettings {
|
||||
pub openh264: bool,
|
||||
/// The ScreenCast portal's token for the last shared screen.
|
||||
pub portal_restore_token: Option<String>,
|
||||
/// The last choices in the share dialog.
|
||||
pub share: ShareDefaults,
|
||||
/// Write crash reports to disk (opt-in; never uploaded).
|
||||
pub crash_reports: bool,
|
||||
@@ -321,8 +327,11 @@ impl Default for UiSettings {
|
||||
/// path, its names from the top as the server has them.
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct LastVoice {
|
||||
/// The id of the server's bookmark.
|
||||
pub bookmark: i64,
|
||||
/// The address the bookmark had then.
|
||||
pub address: String,
|
||||
/// The channel's names from the top.
|
||||
pub channel: Vec<String>,
|
||||
}
|
||||
|
||||
@@ -333,9 +342,13 @@ pub struct LastVoice {
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(default)]
|
||||
pub struct ShareDefaults {
|
||||
/// The frame rate's position in the old list ([`LEGACY_FPS_CHOICES`]).
|
||||
pub fps_index: usize,
|
||||
/// The bitrate's position in the old list ([`LEGACY_BITRATE_CHOICES`]).
|
||||
pub bitrate_index: usize,
|
||||
/// Share the sound too.
|
||||
pub audio: bool,
|
||||
/// Accept the viewers that ask to watch without asking us.
|
||||
pub auto_accept: bool,
|
||||
}
|
||||
|
||||
@@ -350,6 +363,7 @@ impl Default for ShareDefaults {
|
||||
pub struct ClientPlayback {
|
||||
/// Linear, 1 = unchanged.
|
||||
pub volume: f32,
|
||||
/// Not played at all.
|
||||
pub muted: bool,
|
||||
}
|
||||
|
||||
@@ -372,6 +386,7 @@ pub type ClientPlaybackMap = BTreeMap<String, ClientPlayback>;
|
||||
/// Audio devices as listed in the settings: the system default first.
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq)]
|
||||
pub struct DeviceChoices {
|
||||
/// What the list shows, by index.
|
||||
pub names: Vec<String>,
|
||||
/// Device ids by index; `None` for the system default.
|
||||
pub ids: Vec<Option<String>>,
|
||||
|
||||
@@ -117,6 +117,7 @@ pub fn audio_label(kind: &AudioSourceKindSetting) -> (String, String, &'static s
|
||||
pub struct AudioLive {
|
||||
/// Peak in dBFS.
|
||||
pub level: f32,
|
||||
/// What went wrong with the source, if something did.
|
||||
pub error: Option<String>,
|
||||
}
|
||||
|
||||
@@ -502,7 +503,9 @@ pub fn placement(kind: &SourceKind, (w, h): (u32, u32)) -> Transform {
|
||||
/// (`None`: switched off, so it is removed).
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct Overlay {
|
||||
/// The source's name.
|
||||
pub name: &'static str,
|
||||
/// What it shows, none to remove it.
|
||||
pub text: Option<String>,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
//! The Stream Studio's structs: the plain counterparts of
|
||||
//! `crates/voelin-ui/ui/studio-bridge.slint`, as [`crate::bridge`] has those of
|
||||
//! `bridge.slint`.
|
||||
//! `bridge.slint`. As there, the fields are not documented one by one: see the
|
||||
//! comments in `studio-bridge.slint`.
|
||||
#![allow(missing_docs)]
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
|
||||
@@ -56,11 +56,17 @@ pub fn badge_items(guids: &[String], pictures: &HashMap<String, PathBuf>) -> Vec
|
||||
|
||||
/// What the tree shows besides the presence.
|
||||
pub struct TreeInput<'a> {
|
||||
/// The channels and clients of the server.
|
||||
pub presence: &'a Presence,
|
||||
/// The channels folded shut.
|
||||
pub collapsed: &'a HashSet<ChannelId>,
|
||||
/// The clients that are talking.
|
||||
pub talking: &'a HashSet<u16>,
|
||||
/// Local volume and mute of the clients we changed.
|
||||
pub playback: &'a ClientPlaybackMap,
|
||||
/// The channel we are in.
|
||||
pub own_channel: Option<ChannelId>,
|
||||
/// Our own client.
|
||||
pub own_client: Option<u16>,
|
||||
/// Search text: only matching channels and clients (and the channels
|
||||
/// above them) are shown. Empty: everything.
|
||||
|
||||
Reference in new issue
Block a user