pavex_cli_client::client

Struct Client

source
pub struct Client { /* private fields */ }
Expand description

A fluent API for configuring and executing pavex’s CLI commands.

Implementations§

source§

impl Client

source

pub fn new() -> Self

Create a new Client with the default configuration.

source

pub fn generate( self, blueprint: Blueprint, output_directory: PathBuf, ) -> GenerateBuilder

Start building the configuration for the code-generator.

You must specify:

  • The Blueprint for the application that you want to generate;
  • The directory where the generated code should be written.
source§

impl Client

Setters for optional configuration knobs on Client.

source

pub fn pavex_cli_path(self, path: PathBuf) -> Self

Set the path to the pavex executable.

If this is not set, we will assume that pavex is in the PATH.

source

pub fn color(self, color: Color) -> Self

Set whether to use colors in the output of Pavex’s code generator.

If this is not set, Pavex will automatically determine whether to use colors or not.

source

pub fn debug(self) -> Self

Enable debug mode.

This will print additional debug information when running pavex commands.

source

pub fn no_debug(self) -> Self

Disable debug mode.

pavex will not print additional debug information when running commands.
This is the default behaviour.

source

pub fn new_command(self, path: PathBuf) -> NewBuilder

Start building the configuration for the new command.

You must specify the path where the new project should be created.

source

pub fn log(self) -> Self

Enable logging.

pavex will emit internal log messages to the console.

source

pub fn no_log(self) -> Self

Disable logging.

pavex will not emit internal log messages to the console. This is the default behaviour.

source

pub fn log_filter(self, filter: String) -> Self

Set the log filter.

Control which logs are emitted if --log or --perf-profile are enabled. If no filter is specified, Pavex will default to info,pavex=trace.

source

pub fn perf_profile(self) -> Self

Enable performance profiling.

pavex will serialize to disk tracing information to profile command execution.

source

pub fn no_perf_profile(self) -> Self

Disable performance profiling.

pavex will not serialize to disk tracing information to profile command execution. This is the default behaviour.

Trait Implementations§

source§

impl Clone for Client

source§

fn clone(&self) -> Client

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Client

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Client

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl UnwindSafe for Client

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more