Document the fields of the mirrored bridge structs and lift the exemption

The gate minor "field docs on the mirrored bridge structs" was answered with
`#![allow(missing_docs)]` on `bridge` and `studio_bridge`, and the crate's
comment said 400 or so fields. The two modules have 559 pub fields; 210
carried a comment of the .slint files and 349 (288 and 61) had none there.
Each of those is described now, from the code that fills it (the producers
in the view model and in voelin-ui, the settings keys' own documentation,
the gateway protocol's types), and the allow is gone: `#![warn(missing_docs)]`
holds for the whole crate and clippy -D warnings fails on a field without a
comment (checked by deleting one). docs/ui.md and lib.rs give the real
numbers.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-24 19:56:38 +03:00
1 parent 370eaf94ed
commit 26ee8c38c1
4 files changed
+361 -16

No files matched your search

File diff suppressed because it is too large. Load diff
+2 -5
View File
@@ -3,11 +3,8 @@
//! 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.
// Every public item is documented, the 559 fields of the two mirror modules
// (`bridge`, `studio_bridge`) included.
#![warn(missing_docs)]
pub mod avatar;
+62 -3
View File
@@ -1,8 +1,6 @@
//! The Stream Studio's structs: the plain counterparts of
//! `crates/voelin-ui/ui/studio-bridge.slint`, as [`crate::bridge`] has those of
//! `bridge.slint`. As there, the fields are not documented one by one: see the
//! comments in `studio-bridge.slint`.
#![allow(missing_docs)]
//! `bridge.slint`. As there, every field is documented.
use std::sync::Arc;
@@ -11,7 +9,9 @@ use crate::image::ImageRef;
/// A scene of the studio.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct StudioScene {
/// The scene's id.
pub id: i32,
/// The scene's name.
pub name: Arc<str>,
/// Its sources, front first: "Screen + Camera + Text".
pub detail: Arc<str>,
@@ -24,11 +24,15 @@ pub struct StudioScene {
/// A source of the live scene, front first.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct StudioSource {
/// The source's id in its scene.
pub id: i32,
/// The source's name.
pub name: Arc<str>,
/// screen, window, portal, camera, image, text, colour, pattern
pub kind: Arc<str>,
/// It is shown in the output.
pub visible: bool,
/// It cannot be moved, resized or cropped.
pub locked: bool,
/// keep, blur, image, colour
pub background: Arc<str>,
@@ -38,18 +42,22 @@ pub struct StudioSource {
pub info: Arc<str>,
/// At the front or the back (cannot move further).
pub front: bool,
/// At the back; it cannot move further.
pub back: bool,
}
/// An audio source of the stream (`stream.audio_sources`).
#[derive(Clone, Debug, Default, PartialEq)]
pub struct StudioAudio {
/// The source's name.
pub name: Arc<str>,
/// "Elgato Wave:3", the application...
pub detail: Arc<str>,
/// microphone, desktop, app, window, tone
pub kind: Arc<str>,
/// Its gain in dB.
pub gain_db: f32,
/// It is muted in the mix.
pub muted: bool,
/// The meter in dBFS, after the gain.
pub level: f32,
@@ -62,6 +70,7 @@ pub struct StudioAudio {
pub struct StudioLayer {
/// "1280x720"; empty: `scale` of the output.
pub size: Arc<str>,
/// The factor on the output's size when `size` is empty.
pub scale: Arc<str>,
/// Frame-rate cap; empty: the output's.
pub fps: Arc<str>,
@@ -74,7 +83,9 @@ pub struct StudioLayer {
/// A viewer of the studio's stream.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct StudioViewer {
/// The viewer's client id.
pub client: i32,
/// The viewer's name.
pub name: Arc<str>,
/// requested, connecting, connected
pub state: Arc<str>,
@@ -83,7 +94,9 @@ pub struct StudioViewer {
/// An entry of a picker (screens, windows, cameras, audio sources).
#[derive(Clone, Debug, Default, PartialEq)]
pub struct StudioPick {
/// The entry's name.
pub name: Arc<str>,
/// The line under the name.
pub detail: Arc<str>,
/// For the icon: monitor, window, portal, camera, microphone, desktop, app, tone
pub kind: Arc<str>,
@@ -102,48 +115,70 @@ pub struct StudioStatus {
pub destination: Arc<str>,
/// 0: not live, 1: poor, 2: fair, 3: good, 4: excellent.
pub quality: i32,
/// The words for `quality`.
pub quality_text: Arc<str>,
/// "1080p • 60 FPS • 8,250 kbps"
pub format: Arc<str>,
/// The numbers behind it, for the info button.
pub details: Arc<str>,
/// The stream is live.
pub live: bool,
/// Going live: waiting for the server.
pub starting: bool,
/// "00:12:34"
pub elapsed: Arc<str>,
/// How many watch the stream.
pub viewers: i32,
/// How many viewers the stream has, those who only asked included.
pub participants: i32,
/// Go Live is possible.
pub can_go_live: bool,
/// Why Go Live is off, or what goes wrong.
pub hint: Arc<str>,
/// A recording runs.
pub recording: bool,
/// How long the recording runs: "00:12:34".
pub recorded: Arc<str>,
/// The replay buffer's window (0: off) and what it holds now.
pub replay_seconds: i32,
/// What the replay buffer holds now: "30 s".
pub replay_held: Arc<str>,
/// The output's width in pixels.
pub output_width: i32,
/// The output's height in pixels.
pub output_height: i32,
/// The output's frame rate.
pub fps: i32,
/// The studio is in a window of its own.
pub detached: bool,
/// A window of its own is possible (not on Android).
pub can_detach: bool,
/// The live scene shows a screen, a camera, a window (the phone's cards).
pub screen_shown: bool,
/// The live scene shows a camera.
pub camera_shown: bool,
/// The live scene shows a window.
pub window_shown: bool,
}
/// The stream settings panel (`studio.stream`, `stream.bitrate_kbps`).
#[derive(Clone, Debug, Default, PartialEq)]
pub struct StudioForm {
/// Index into the destinations offered (channels to stream to); -1: none.
pub destination: i32,
/// The stream's title.
pub title: Arc<str>,
/// Game or category: it follows the title in the stream's name.
pub game: Arc<str>,
/// Sent to the channel's chat when the stream goes live.
pub message: Arc<str>,
/// The viewers are an overlay in the live scene.
pub show_viewers: bool,
/// The stream chat's last lines are an overlay.
pub show_chat: bool,
/// The title and the game are an overlay.
pub show_now_playing: bool,
/// The stream carries the mixer's sources; off: none.
pub audio: bool,
/// kbit/s of the stream without layers, as typed.
pub bitrate: Arc<str>,
@@ -153,45 +188,69 @@ pub struct StudioForm {
/// sources: `id` -1). Numbers as typed.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct StudioSourceForm {
/// The source's id; -1: a new one.
pub id: i32,
/// The source's name.
pub name: Arc<str>,
/// screen, window, portal, camera, image, text, colour or pattern.
pub kind: Arc<str>,
/// The left edge in output pixels.
pub x: Arc<str>,
/// The top edge in output pixels.
pub y: Arc<str>,
/// Empty: the source's own size times `scale`.
pub width: Arc<str>,
/// As `width`, for the height.
pub height: Arc<str>,
/// The factor on the source's own size, where `width` or `height` is empty.
pub scale: Arc<str>,
/// contain, cover, stretch
pub fit: Arc<str>,
/// Pixels cut off the source's left edge.
pub crop_left: Arc<str>,
/// Pixels cut off its top edge.
pub crop_top: Arc<str>,
/// Pixels cut off its right edge.
pub crop_right: Arc<str>,
/// Pixels cut off its bottom edge.
pub crop_bottom: Arc<str>,
/// Percent.
pub opacity: f32,
/// It cannot be moved, resized or cropped.
pub locked: bool,
/// It is shown in the output.
pub visible: bool,
/// keep, blur, image, colour
pub background: Arc<str>,
/// Blur radius in percent of the picture's height.
pub blur: Arc<str>,
/// The picture behind the source, for the background `image`.
pub background_path: Arc<str>,
/// The colour behind the source, for the background `colour`.
pub background_colour: Arc<str>,
/// Text, colour ("#rrggbb" or "#rrggbbaa") and image sources.
pub text: Arc<str>,
/// The text's size in pixels.
pub text_size: Arc<str>,
/// The text's or the colour source's colour.
pub colour: Arc<str>,
/// The image source's file.
pub path: Arc<str>,
/// The camera picture is mirrored.
pub mirror: bool,
}
/// The studio settings dialog (`studio.*` keys and the preview).
#[derive(Clone, Debug, Default, PartialEq)]
pub struct StudioSettingsForm {
/// Seconds the replay buffer keeps; 0: off.
pub replay_seconds: Arc<str>,
/// MiB of the replay buffer kept in memory.
pub replay_memory: Arc<str>,
/// The folder of recordings and clips; empty: the default.
pub recording_dir: Arc<str>,
/// The preview's width in pixels.
pub preview_width: Arc<str>,
/// The preview's frame rate.
pub preview_fps: Arc<str>,
}
+5 -4
View File
@@ -124,10 +124,11 @@ this file is `voelin_ui_vm::chat`. The boundary:
structs with the field names of the Slint structs in `bridge.slint` and
`studio-bridge.slint`; `MytsBadge` and `MytsForm`, which have no data source
in this build, stay Slint-only. The crate warns about undocumented public
items (`#![warn(missing_docs)]`) and has none, but the two mirror modules
carry `#![allow(missing_docs)]`: their 349 fields (288 in `bridge.rs`, 61 in
`studio_bridge.rs`) are not documented one by one, the comments in the
`.slint` files are the place to read them until the Slint front end goes.
items (`#![warn(missing_docs)]`) and has none, the mirror modules' 559
fields (460 in `bridge.rs`, 99 in `studio_bridge.rs`) included: 210 carry
the comments of the `.slint` files, and the other 349 (288 in `bridge.rs`,
61 in `studio_bridge.rs`), which had none there, were described from the
code that fills them. No module is exempt from the lint.
- **Lists.** `list::diff(old, new)` gives `Changes`: updates, removals and
insertions by index, in the order to apply them. `bind/rows.rs` applies
them to a `VecModel` and converts only the changed rows; a GPUI view