#[non_exhaustive]pub struct ModuleHost {
pub runtime: String,
}Expand description
Runs Python sources in this interpreter through runtime, a Python module the host provides (what it defines: the crate’s “The runtime module”).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.runtime: StringThe runtime module’s import name, such as sqlload._runtime.
Trait Implementations§
Source§impl Clone for ModuleHost
impl Clone for ModuleHost
Source§impl Debug for ModuleHost
impl Debug for ModuleHost
impl Eq for ModuleHost
Source§impl PartialEq for ModuleHost
impl PartialEq for ModuleHost
Source§impl PythonHost for ModuleHost
impl PythonHost for ModuleHost
Source§fn discover(
&self,
root: &Path,
python_paths: &[PathBuf],
) -> Result<Vec<PythonSource>, String>
fn discover( &self, root: &Path, python_paths: &[PathBuf], ) -> Result<Vec<PythonSource>, String>
Import every module under
python_paths (relative to root) and return the sources declared there.Source§fn read_table(
&self,
request: &TableRead,
) -> Result<Box<dyn BatchStream>, String>
fn read_table( &self, request: &TableRead, ) -> Result<Box<dyn BatchStream>, String>
Call a table function and stream what it yields.
Source§fn table_state(&self, table: &str) -> Result<Option<String>, String>
fn table_state(&self, table: &str) -> Result<Option<String>, String>
The position the table function last started for
table left in ctx.state, as JSON text; None when it set none.Source§fn transform_version(&self, name: &str) -> Result<String, String>
fn transform_version(&self, name: &str) -> Result<String, String>
Look up the
transform that @sl.transform registered as name and check it can run: its version, name@ and a hash of the file it is defined in, or why it cannot (no function, or two, registered as name).Source§fn transform(
&self,
call: &TransformCall,
rows: Vec<RecordBatch>,
schema: SchemaRef,
) -> Result<Box<dyn BatchStream>, String>
fn transform( &self, call: &TransformCall, rows: Vec<RecordBatch>, schema: SchemaRef, ) -> Result<Box<dyn BatchStream>, String>
Call a
transform on rows (in schema) and stream what it returned or yielded, crossed as a table function’s yields are, as it yields it.Source§fn rename(
&self,
name: &str,
columns: Option<&str>,
context: &str,
) -> Result<String, String>
fn rename( &self, name: &str, columns: Option<&str>, context: &str, ) -> Result<String, String>
Call the
rename function @sl.rename registered as name on columns (JSON: each column’s position, source and default name) with its ctx (JSON: source, table): the names it gives, by position, as a JSON object; with no columns, only look the function up. Fails when no function, or two, are registered as name, or it fails or returns something else.impl StructuralPartialEq for ModuleHost
Auto Trait Implementations§
impl Forget for ModuleHost
impl Freeze for ModuleHost
impl Move for ModuleHost
impl RefUnwindSafe for ModuleHost
impl Send for ModuleHost
impl Sync for ModuleHost
impl Unpin for ModuleHost
impl UnsafeUnpin for ModuleHost
impl UnwindSafe for ModuleHost
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request