pub struct ZinitHandle { /* private fields */ }Expand description
Synchronous handle for Rhai functions to use
Implementations§
Source§impl ZinitHandle
impl ZinitHandle
Sourcepub fn with_client(client: ZinitClient) -> Result<Self>
pub fn with_client(client: ZinitClient) -> Result<Self>
Create a new handle with a specific client
pub fn ping(&self) -> Result<PingResponse>
pub fn shutdown(&self) -> Result<bool>
pub fn reboot(&self) -> Result<bool>
pub fn list(&self) -> Result<Vec<String>>
pub fn status(&self, name: &str) -> Result<ServiceStatus>
pub fn start(&self, name: &str) -> Result<()>
pub fn stop(&self, name: &str) -> Result<()>
pub fn restart(&self, name: &str) -> Result<()>
pub fn delete(&self, name: &str) -> Result<()>
pub fn kill(&self, name: &str, signal: &str) -> Result<()>
pub fn stats(&self, name: &str) -> Result<ServiceStats>
pub fn is_running(&self, name: &str) -> Result<bool>
pub fn monitor(&self, name: &str, config: ServiceConfig) -> Result<()>
pub fn start_all(&self) -> Result<()>
pub fn stop_all(&self) -> Result<()>
pub fn delete_all(&self) -> Result<()>
pub fn logs(&self) -> Result<Vec<String>>
pub fn logs_filter(&self, service: &str) -> Result<Vec<String>>
pub fn logs_tail(&self, n: u32) -> Result<Vec<String>>
pub fn xinit_list(&self) -> Result<Vec<String>>
pub fn xinit_register( &self, name: &str, listen: &[String], backend: &str, service: &str, idle_timeout: u64, connect_timeout: u64, ) -> Result<()>
pub fn xinit_unregister(&self, name: &str) -> Result<()>
pub fn xinit_status(&self, name: &str) -> Result<XinitStatus>
pub fn xinit_status_all(&self) -> Result<Vec<XinitStatus>>
Sourcepub fn register(&self, name: &str, config: ServiceConfig) -> Result<()>
pub fn register(&self, name: &str, config: ServiceConfig) -> Result<()>
Register a service: save config to YAML file and monitor it
Sourcepub fn get(&self, name: &str) -> Result<ServiceConfig>
pub fn get(&self, name: &str) -> Result<ServiceConfig>
Get service configuration from YAML file on disk
Trait Implementations§
Source§impl Clone for ZinitHandle
impl Clone for ZinitHandle
Source§fn clone(&self) -> ZinitHandle
fn clone(&self) -> ZinitHandle
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 Freeze for ZinitHandle
impl RefUnwindSafe for ZinitHandle
impl Send for ZinitHandle
impl Sync for ZinitHandle
impl Unpin for ZinitHandle
impl UnwindSafe for ZinitHandle
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> 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