Skip to main content

Config

Struct Config 

Source
pub struct Config {
    pub python: Option<String>,
    pub script: Option<PathBuf>,
    pub bundle: Option<String>,
    pub args: Option<Vec<String>>,
    pub invoke_timeout_ms: Option<u64>,
    pub shutdown_timeout_ms: Option<u64>,
    pub restart_on_crash: Option<bool>,
}
Expand description

tauri.conf.json 中的 plugins.py-runtime 配置,Builder 上设置的值优先。

键名为 camelCase,且拒绝未知键,拼写错误会在启动时报错而不是被静默忽略。 env 与 handshake_timeout 只能通过 Builder 设置。

Fields§

§python: Option<String>

Python 解释器,见 Builder::python。

§script: Option<PathBuf>

Python 入口脚本;相对路径的解析规则见 Builder::script。

§bundle: Option<String>

Nuitka 打包产物名,见 Builder::bundle。

§args: Option<Vec<String>>

追加在脚本路径(或打包产物)之后的命令行参数。

§invoke_timeout_ms: Option<u64>

每次调用的默认超时(毫秒),见 Builder::invoke_timeout。

§shutdown_timeout_ms: Option<u64>

关闭超时(毫秒),见 Builder::shutdown_timeout。

§restart_on_crash: Option<bool>

崩溃后是否自动重启,见 Builder::restart_on_crash。

Trait Implementations§

Source§

impl Debug for Config

Source§

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

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

impl Default for Config

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for Config

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

§

impl Forget for Config

§

impl Freeze for Config

§

impl Move for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnsafeUnpin for Config

§

impl UnwindSafe for Config

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<'de, D, R> CommandArg<'de, R> for D
where D: Deserialize<'de>, R: Runtime,

Source§

fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>

Derives an instance of Self from the CommandItem. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ScopeObject for T
where T: Send + Sync + Debug + DeserializeOwned + 'static,

Source§

type Error = Error

The error type.
Source§

fn deserialize<R>( _app: &AppHandle<R>, raw: Value, ) -> Result<T, <T as ScopeObject>::Error>
where R: Runtime,

Deserialize the raw scope value.
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.