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

Build step for generating runtime functions and dictionary

Implementations§

source§

impl ConfigBuilder

source

pub fn new() -> Self

Creates a new ConfigBuilder

source

pub fn entry(self, path: impl AsRef<Path>) -> Self

Adds an entry point

The builder will start from all supplied entries, parsing these modules and all their submodules.

Generally this should be done only for the src/main.rs file of a project.

source

pub fn entry_module(self, path: impl AsRef<Path>, module: &[Ident]) -> Self

Like entry but specifies the starting module path.

For src/main.rs this is an empty list, and each submodule adds an element to the module path. E.g. crate::module::submodule would be [module, submodule].

Generally it should not be necessary to use this function.

source

pub fn set_version(self, version: impl AsRef<str>) -> Self

Sets the version string that will be placed in the dictionary

source

pub fn set_build_versions(self, build_versions: impl AsRef<str>) -> Self

Sets the build version string that will be placed in the dictionary

It is customary for this string to be formatted as a space separated list of pairs as so:

gcc: (15:7-2018-q2-6) 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907] binutils: (2.31.1-11+rpi1+11) 2.31.1)

Anchor does not enforce this, and allows the user to set any valid string value.

source

pub fn skip_command(self, command: impl AsRef<str>) -> Self

Ignores the klipper_command with a given name

This can be used for disabling certain commands in specific builds. Generally it is preferable to use #[cfg(feature)] tags for disabling commands.

source

pub fn build(self)

Runs the build step

Trait Implementations§

source§

impl Debug for ConfigBuilder

source§

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

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

impl Default for ConfigBuilder

source§

fn default() -> ConfigBuilder

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

Auto Trait Implementations§

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.