Skip to main content

tauri_plugin_compmd/
served.rs

1//! What the plugin keeps for the app: the frames' build and the scheme it serves them on.
2
3use crate::frames::Frames;
4
5/// The frames the app serves, and the scheme they are served on, as the app's state.
6pub struct Served {
7    /// The build read when the app started.
8    pub frames: Frames,
9    /// The scheme's name, such as `compmd`.
10    pub scheme: String,
11}
12
13impl Served {
14    /// The frames' `base` (`Frames::base`) on the plugin's scheme.
15    #[must_use]
16    pub fn base(&self) -> Option<String> {
17        self.frames.base(&self.scheme)
18    }
19}