#[non_exhaustive]pub struct SecondInstance {
pub args: Vec<String>,
pub cwd: String,
}Expand description
A later launch of the app (TS: Application.on("secondInstance", ...),
Rust: next_second_instance).
Anyone can start the app with any arguments: they are untrusted input.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.args: Vec<String>Its command line’s arguments, the program’s path not included.
cwd: StringThe directory it was started in, which relative paths among
args are relative to; empty when unknown.
Implementations§
Source§impl SecondInstance
impl SecondInstance
Sourcepub fn new(args: Vec<String>, cwd: impl Into<String>) -> Self
pub fn new(args: Vec<String>, cwd: impl Into<String>) -> Self
A launch with args started in cwd.
Sourcepub fn to_payload(&self) -> EventPayload
pub fn to_payload(&self) -> EventPayload
The payload of EventKind::SecondInstance
carrying it.
Sourcepub fn to_json(&self) -> JsonValue
pub fn to_json(&self) -> JsonValue
As JSON: { "args": [...], "cwd": "..." }, the form a second
process hands the first.
Sourcepub fn from_json(value: &JsonValue) -> Option<Self>
pub fn from_json(value: &JsonValue) -> Option<Self>
The launch Self::to_json wrote; None for anything else.
Sourcepub fn from_payload(payload: &EventPayload) -> Option<Self>
pub fn from_payload(payload: &EventPayload) -> Option<Self>
The launch a payload of
EventKind::SecondInstance carries.
Trait Implementations§
Source§impl Clone for SecondInstance
impl Clone for SecondInstance
Source§impl Debug for SecondInstance
impl Debug for SecondInstance
Source§impl Default for SecondInstance
impl Default for SecondInstance
impl Eq for SecondInstance
Source§impl PartialEq for SecondInstance
impl PartialEq for SecondInstance
impl StructuralPartialEq for SecondInstance
Auto Trait Implementations§
impl Forget for SecondInstance
impl Freeze for SecondInstance
impl Move for SecondInstance
impl RefUnwindSafe for SecondInstance
impl Send for SecondInstancewhere
RawVecInner: Send,
impl Sync for SecondInstancewhere
RawVecInner: Sync,
impl Unpin for SecondInstance
impl UnsafeUnpin for SecondInstancewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for SecondInstancewhere
RawVecInner: UnwindSafe,
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