pub struct PythonTorchRuntimeConfig {
pub python_executable: PathBuf,
pub module_search_roots: Vec<PathBuf>,
pub workload_factory: String,
pub workload_config: Value,
pub env: BTreeMap<String, String>,
}Expand description
Configures how the Rust runtime launches the Python worker process.
Fields§
§python_executable: PathBufPython executable used to launch the runtime worker.
module_search_roots: Vec<PathBuf>Additional module roots appended to PYTHONPATH.
workload_factory: StringPython workload factory in module:attr form.
workload_config: ValueJSON config passed directly to the Python workload.
env: BTreeMap<String, String>Additional environment variables for the worker process.
Implementations§
Source§impl PythonTorchRuntimeConfig
impl PythonTorchRuntimeConfig
Sourcepub fn new(
python_executable: impl Into<PathBuf>,
workload_factory: impl Into<String>,
workload_config: Value,
) -> Self
pub fn new( python_executable: impl Into<PathBuf>, workload_factory: impl Into<String>, workload_config: Value, ) -> Self
Creates a new config for the provided Python workload factory.
Sourcepub fn with_module_search_root(self, root: impl Into<PathBuf>) -> Self
pub fn with_module_search_root(self, root: impl Into<PathBuf>) -> Self
Adds one extra Python import root.
Trait Implementations§
Source§impl Clone for PythonTorchRuntimeConfig
impl Clone for PythonTorchRuntimeConfig
Source§fn clone(&self) -> PythonTorchRuntimeConfig
fn clone(&self) -> PythonTorchRuntimeConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PythonTorchRuntimeConfig
impl Debug for PythonTorchRuntimeConfig
Source§impl<'de> Deserialize<'de> for PythonTorchRuntimeConfig
impl<'de> Deserialize<'de> for PythonTorchRuntimeConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 Freeze for PythonTorchRuntimeConfig
impl RefUnwindSafe for PythonTorchRuntimeConfig
impl Send for PythonTorchRuntimeConfig
impl Sync for PythonTorchRuntimeConfig
impl Unpin for PythonTorchRuntimeConfig
impl UnsafeUnpin for PythonTorchRuntimeConfig
impl UnwindSafe for PythonTorchRuntimeConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CanonicalSchema for Twhere
T: Serialize,
impl<T> CanonicalSchema for Twhere
T: Serialize,
Source§fn to_cbor_vec(&self) -> Result<Vec<u8>, SchemaError>
fn to_cbor_vec(&self) -> Result<Vec<u8>, SchemaError>
Serializes the value into canonical CBOR bytes.
Source§fn content_id(&self) -> Result<ContentId, SchemaError>
fn content_id(&self) -> Result<ContentId, SchemaError>
Computes the canonical content identifier for the value.