pub struct ServerManager<T: ApiProvider> { /* private fields */ }
Implementations§
Source§impl<T: ApiProvider> ServerManager<T>
impl<T: ApiProvider> ServerManager<T>
pub fn new(api_client: T) -> Self
pub fn with_check_interval(self, interval: Duration) -> Self
pub fn with_crash_detector(self, detector: CrashDetector) -> Self
pub fn with_process_provider<P: ProcessProvider + 'static>( self, provider: P, ) -> Self
pub fn api_client(&self) -> &Arc<T>
pub async fn monitor_server( &self, server_id: &str, ) -> Result<(), ServerManagerError>
pub async fn start_server( &self, server_id: &str, ) -> Result<(), ServerManagerError>
pub async fn stop_server( &self, server_id: &str, ) -> Result<(), ServerManagerError>
pub async fn restart_server( &self, server_id: &str, ) -> Result<(), ServerManagerError>
pub fn execute_system_command( &self, command: &str, ) -> Result<String, ServerManagerError>
pub async fn get_server_status( &self, server_id: &str, ) -> Result<ServerStatus, ServerManagerError>
pub async fn write_stdin( &self, server_id: &str, input: &str, ) -> Result<(), ServerManagerError>
pub fn get_stdout_stream( &self, server_id: &str, ) -> Result<Receiver<String>, ServerManagerError>
pub fn is_process_running( &self, server_id: &str, ) -> Result<bool, ServerManagerError>
pub async fn force_stop_process( &self, server_id: &str, ) -> Result<(), ServerManagerError>
Trait Implementations§
Source§impl<T: Clone + ApiProvider> Clone for ServerManager<T>
impl<T: Clone + ApiProvider> Clone for ServerManager<T>
Source§fn clone(&self) -> ServerManager<T>
fn clone(&self) -> ServerManager<T>
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 moreAuto Trait Implementations§
impl<T> Freeze for ServerManager<T>
impl<T> !RefUnwindSafe for ServerManager<T>
impl<T> Send for ServerManager<T>
impl<T> Sync for ServerManager<T>
impl<T> Unpin for ServerManager<T>
impl<T> !UnwindSafe for ServerManager<T>
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