pub struct Unit { /* private fields */ }
Expand description

The Unit application context.

This object wraps the libunit library, which talks to the Unit server over shared memory and a unix socket in order to receive data about requests.

Implementations

Create a new Unit context and initialize the Unit application.

Note: Only one Unit object may be active in a single process.

Set a request handler for the Unit application.

The handler must be a function or lambda function that takes a UnitRequest object and returns a UnitResult<()>.

Enter the main event loop, handling requests until the Unit server exits or requests a restart.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.