tauri_build

Struct CodegenContext

Source
pub struct CodegenContext { /* private fields */ }
Available on crate feature codegen only.
Expand description

A builder for generating a Tauri application context during compile time.

Implementations§

Source§

impl CodegenContext

Source

pub fn new() -> Self

Create a new CodegenContext builder that is already filled with the default options.

Source

pub fn config_path(self, config_path: impl Into<PathBuf>) -> Self

Set the path to the tauri.conf.json (relative to the package’s directory).

This defaults to a file called tauri.conf.json inside of the current working directory of the package compiling; does not need to be set manually if that config file is in the same directory as your Cargo.toml.

Source

pub fn out_file(self, filename: PathBuf) -> Self

Sets the output file’s path.

Note: This path should be relative to the OUT_DIR.

Don’t set this if you are using tauri::tauri_build_context! as that helper macro expects the default value. This option can be useful if you are not using the helper and instead using std::include! on the generated code yourself.

Defaults to tauri-build-context.rs.

Source

pub fn capability<P: AsRef<Path>>(self, path: P) -> Self

Adds a capability file to the generated context.

Trait Implementations§

Source§

impl Debug for CodegenContext

Source§

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

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

impl Default for CodegenContext

Source§

fn default() -> Self

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

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T