pub struct SingleInstanceConfig {
pub id: String,
pub forward_args: bool,
}Expand description
单实例配置。
第一个实例持有本地 socket;后续实例把命令行参数转发给它后立即退出,
由第一个实例的 RunnerApp::on_second_instance 处理(例如文件关联打开)。
id 必须在同一应用的所有版本/会话中保持稳定,建议直接用 app_id。
Fields§
§id: String§forward_args: bool第二实例是否把命令行参数转发给第一实例;false 时只退出。
Implementations§
Source§impl SingleInstanceConfig
impl SingleInstanceConfig
pub fn new(id: impl Into<String>) -> SingleInstanceConfig
pub fn with_forward_args(self, forward: bool) -> SingleInstanceConfig
Trait Implementations§
Source§impl Clone for SingleInstanceConfig
impl Clone for SingleInstanceConfig
Source§fn clone(&self) -> SingleInstanceConfig
fn clone(&self) -> SingleInstanceConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SingleInstanceConfig
impl Debug for SingleInstanceConfig
impl Eq for SingleInstanceConfig
Source§impl PartialEq for SingleInstanceConfig
impl PartialEq for SingleInstanceConfig
impl StructuralPartialEq for SingleInstanceConfig
Auto Trait Implementations§
impl Freeze for SingleInstanceConfig
impl RefUnwindSafe for SingleInstanceConfig
impl Send for SingleInstanceConfig
impl Sync for SingleInstanceConfig
impl Unpin for SingleInstanceConfig
impl UnsafeUnpin for SingleInstanceConfig
impl UnwindSafe for SingleInstanceConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.