Struct smf::Query [−][src]
pub struct Query { /* fields omitted */ }
Queries the underlying system to return SvcStatus structures.
Acts as a wrapper around the underlying ‘svcs’ command.
Implementations
impl Query
[src]
impl Query
[src]pub fn zone<S: AsRef<str>>(&mut self, zone: S) -> &mut Query
[src]
pub fn zone<S: AsRef<str>>(&mut self, zone: S) -> &mut Query
[src]Requests a query be issued within a specific zone.
pub fn get_status_all(
&self
) -> Result<impl Iterator<Item = SvcStatus>, QueryError>
[src]
pub fn get_status_all(
&self
) -> Result<impl Iterator<Item = SvcStatus>, QueryError>
[src]Syntactic sugar for Query::get_status with a selection of QuerySelection::All.
See: The corresponding Rust issue on inferred default types for more context on why this method exists - it is more ergonomic than invoking Self::get_status with QuerySelection::All directly.
pub fn get_status<S, I>(
&self,
selection: QuerySelection<S, I>
) -> Result<impl Iterator<Item = SvcStatus>, QueryError> where
S: AsRef<str>,
I: IntoIterator<Item = S>,
[src]
pub fn get_status<S, I>(
&self,
selection: QuerySelection<S, I>
) -> Result<impl Iterator<Item = SvcStatus>, QueryError> where
S: AsRef<str>,
I: IntoIterator<Item = S>,
[src]Queries for status information from the corresponding query.
Returns status information for all services which match the QuerySelection argument.
pub fn get_dependencies_of<S, I>(
&self,
patterns: I
) -> Result<impl Iterator<Item = SvcStatus>, QueryError> where
S: AsRef<str>,
I: IntoIterator<Item = S>,
[src]
pub fn get_dependencies_of<S, I>(
&self,
patterns: I
) -> Result<impl Iterator<Item = SvcStatus>, QueryError> where
S: AsRef<str>,
I: IntoIterator<Item = S>,
[src]Returns the statuses of service instances upon which the provided instances depend.
let service_statuses = smf::Query::new() .get_dependencies_of(&["svcs:/system/filesystem/minimal"]) .unwrap(); // `service_statuses` includes services which boot before the // minimal filesystem.
pub fn get_dependents_of<S, I>(
&self,
patterns: I
) -> Result<impl Iterator<Item = SvcStatus>, QueryError> where
S: AsRef<str>,
I: IntoIterator<Item = S>,
[src]
pub fn get_dependents_of<S, I>(
&self,
patterns: I
) -> Result<impl Iterator<Item = SvcStatus>, QueryError> where
S: AsRef<str>,
I: IntoIterator<Item = S>,
[src]Returns the statuses of service instances that depend on the provided instances.
let service_statuses = smf::Query::new() .get_dependents_of(&["svcs:/system/filesystem/minimal"]) .unwrap(); // `service_statuses` includes services which need a minimal // filesystem.
pub fn get_log_files<S, I>(
&self,
patterns: I
) -> Result<impl Iterator<Item = PathBuf>, QueryError> where
S: AsRef<str>,
I: IntoIterator<Item = S>,
[src]
pub fn get_log_files<S, I>(
&self,
patterns: I
) -> Result<impl Iterator<Item = PathBuf>, QueryError> where
S: AsRef<str>,
I: IntoIterator<Item = S>,
[src]Acquires the log files for services which match the provided FMRIs or glob patterns.
let log_file = smf::Query::new() .get_log_files(vec!["svc:/system/filesystem/minimal"]).unwrap() .next().unwrap();