Crate sopht

Source
Expand description

sopht is a program for managing long running processes in a (slightly) more sophisticated way than something like tmux. this library currently implements the IPC protocol sopht uses to pass commands and responses between clients and a server, as well as the machinery required for starting and managing child processes

Re-exports§

pub use ipc::create_client_connection;
pub use ipc::socket_file_path;
pub use ipc::Connection;
pub use manager::ChangeRestartPolicyArgs;
pub use manager::ExitStatus;
pub use manager::ProcessStatus;
pub use manager::RestartPolicy;
pub use manager::SendArgs;
pub use manager::StartArgs;
pub use manager::State;
pub use process::Process;
pub use process::PID;

Modules§

ipc
this module contains all the shared IPC logic agnostic to servers and clients. in particular, it contains the Message type and its components and the Connection type, which abstracts away sopht’s messaging protocol
manager
contains all structures and functions related to the State structure. this includes the implementations of all the server-side process management functions like start and status as well as things like RestartPolicy and [ManagedProcess]
process
this module contains all necessary logic for starting and interacting with processes across all platforms

Structs§

Response
represents a response from the server to the client. this should never be received by a server. additionally, this structure is subject to change in the future as responses get more detailed

Enums§

Command
represents a command to be executed by a server. this should never be received by a client.
Error
union of all errors resulting from sopht functions. this type implements Display and Error, and is the error type of sopht::Result.
Message
union of all different message types. currently the only two message types are Command and Response. the Command variant should only ever be sent by clients and received by servers, and the Response variant should only ever be received by clients and sent by servers

Functions§

create_local_dirs
attempts to create the local directories required for sopht

Type Aliases§

Result
specialized Result type for return values from sopht functions