pub trait Unit {
type Socket: Socket;
// Required methods
async fn list(
&mut self,
name: Option<&str>,
) -> Result<Result<ListOutput, UnitError>>;
fn chain_list<'c, '__proxy_params>(
&'c mut self,
name: Option<&'__proxy_params str>,
) -> Result<Chain<'c, Self::Socket>>;
}Expand description
Proxy trait for calling methods on the io.systemd.Unit interface.
Required Associated Types§
Required Methods§
Sourceasync fn list(
&mut self,
name: Option<&str>,
) -> Result<Result<ListOutput, UnitError>>
async fn list( &mut self, name: Option<&str>, ) -> Result<Result<ListOutput, UnitError>>
Look up a single unit by name.
Called without the more flag and with a name, this returns one unit
rather than streaming every unit — which is what monitord wants: a
filtered call costs ~0.5ms against ~92ms to stream all 305 units on a
test host, and monitord only needs a handful per collection.
Sourcefn chain_list<'c, '__proxy_params>(
&'c mut self,
name: Option<&'__proxy_params str>,
) -> Result<Chain<'c, Self::Socket>>
fn chain_list<'c, '__proxy_params>( &'c mut self, name: Option<&'__proxy_params str>, ) -> Result<Chain<'c, Self::Socket>>
Start a chain with this method call.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".