MCPcopy Create free account
hub / github.com/NVIDIA-NeMo/Switchyard / lease_from_python

Function lease_from_python

crates/switchyard-py/src/interop/context.rs:78–83  ·  view source on GitHub ↗

Leases the native context carried by a Python `ProxyContext`.

(value: &Bound<'_, PyAny>)

Source from the content-addressed store, hash-verified

76
77/// Leases the native context carried by a Python `ProxyContext`.
78pub(crate) fn lease_from_python(value: &Bound<'_, PyAny>) -> PyResult<PyProxyContextLease> {
79 value
80 .getattr("_native")?
81 .extract::<PyRef<'_, PyProxyContext>>()?
82 .lease()
83}
84
85/// Inserts a typed value into a Python context's native state.
86pub(crate) fn insert_into_python<T>(value: &Bound<'_, PyAny>, item: T) -> PyResult<()>

Callers 4

processMethod · 0.85
processMethod · 0.85
processMethod · 0.85
callMethod · 0.85

Calls 1

leaseMethod · 0.80

Tested by

no test coverage detected