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

Representation of a PostgreSQL cluster.

The cluster may not yet exist on disk. It may exist but be stopped, or it may be running. The methods here can be used to create, start, introspect, stop, and destroy the cluster. There’s no protection against concurrent changes to the cluster made by other processes, but the functions in the coordinate module may help.

Implementations

A fairly simplistic check: does the data directory exist and does it contain a file named PG_VERSION?

Check if this cluster is running.

Tries to distinguish carefully between “definitely running”, “definitely not running”, and “don’t know”. The latter results in ClusterError.

Return the path to the PID file used in this cluster.

The PID file does not necessarily exist.

Return the path to the log file used in this cluster.

The log file does not necessarily exist.

Create the cluster if it does not already exist.

Create the named database.

Drop the named database.

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.

Should always be Self

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.