Skip to main content

Unit

Trait Unit 

Source
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§

Source

type Socket: Socket

The socket type used for the connection.

Required Methods§

Source

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.

Source

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".

Implementations on Foreign Types§

Source§

impl<S> Unit for Connection<S>
where S: Socket,

Source§

type Socket = S

Source§

async fn list( &mut self, name: Option<&str>, ) -> Result<Result<ListOutput, UnitError>>

Source§

fn chain_list<'c, '__proxy_params>( &'c mut self, name: Option<&'__proxy_params str>, ) -> Result<Chain<'c, Self::Socket>>

Implementors§