pub struct AppSettings {Show 21 fields
pub port_mode: PortMode,
pub port: u16,
pub host: String,
pub theme: String,
pub language: String,
pub web_theme: String,
pub web_language: String,
pub db_path: Option<String>,
pub workspaces: Vec<WorkspaceSettings>,
pub tray_resident: bool,
pub default_search: bool,
pub default_viewed: bool,
pub default_live: bool,
pub default_edit: bool,
pub default_shared_annotation: bool,
pub web_styles: HashMap<String, String>,
pub shortcuts: HashMap<String, Value>,
pub auto_update: bool,
pub update_channel: String,
pub window_width: Option<u32>,
pub window_height: Option<u32>,
}Fields§
§port_mode: PortMode§port: u16§host: String§theme: String§language: String§web_theme: String§web_language: String§db_path: Option<String>§workspaces: Vec<WorkspaceSettings>§tray_resident: bool§default_search: bool§default_viewed: bool§default_live: bool§default_edit: bool§web_styles: HashMap<String, String>§shortcuts: HashMap<String, Value>§auto_update: bool§update_channel: String§window_width: Option<u32>§window_height: Option<u32>Implementations§
Source§impl AppSettings
impl AppSettings
pub fn settings_path() -> PathBuf
pub fn load() -> Self
pub fn save(&self) -> Result<(), String>
pub fn to_server_config(&self, port: u16) -> ServerConfig
pub fn effective_web_language(&self) -> Option<String>
Sourcepub fn persist_hook(settings: Arc<Mutex<AppSettings>>) -> PersistHook
pub fn persist_hook(settings: Arc<Mutex<AppSettings>>) -> PersistHook
Build a registry persist-hook that mirrors every registry mutation
back into the shared AppSettings and writes to disk. CLI daemon and
GUI both wire this so workspace changes initiated from either side
end up with the same persistent state.
pub fn render_shortcuts_json(&self) -> Option<String>
Sourcepub fn sync_from_registry(&mut self, registry: &WorkspaceRegistry)
pub fn sync_from_registry(&mut self, registry: &WorkspaceRegistry)
Overwrite workspaces with the current registry contents.
pub fn render_styles_css(&self) -> Option<String>
Trait Implementations§
Source§impl Clone for AppSettings
impl Clone for AppSettings
Source§fn clone(&self) -> AppSettings
fn clone(&self) -> AppSettings
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AppSettings
impl Debug for AppSettings
Source§impl Default for AppSettings
impl Default for AppSettings
Source§impl<'de> Deserialize<'de> for AppSettingswhere
AppSettings: Default,
impl<'de> Deserialize<'de> for AppSettingswhere
AppSettings: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AppSettings
impl RefUnwindSafe for AppSettings
impl Send for AppSettings
impl Sync for AppSettings
impl Unpin for AppSettings
impl UnsafeUnpin for AppSettings
impl UnwindSafe for AppSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more