pub struct UdfRegistry { /* private fields */ }Expand description
Session-scoped UDF registry. Rust UDFs run lazily via Polars Expr::map.
Implementations§
Source§impl UdfRegistry
impl UdfRegistry
pub fn new() -> UdfRegistry
Sourcepub fn register_rust_udf<F>(&self, name: &str, f: F) -> Result<(), PolarsError>
pub fn register_rust_udf<F>(&self, name: &str, f: F) -> Result<(), PolarsError>
Register a Rust UDF. Runs lazily when used in DataFrame operations.
Sourcepub fn get_rust_udf(
&self,
name: &str,
case_sensitive: bool,
) -> Result<Option<Arc<dyn RustUdf>>, PolarsError>
pub fn get_rust_udf( &self, name: &str, case_sensitive: bool, ) -> Result<Option<Arc<dyn RustUdf>>, PolarsError>
Look up a Rust UDF by name. Case sensitivity follows session config.
Returns Err if the registry lock is poisoned (e.g. a thread panicked while holding it).
Sourcepub fn has_udf(
&self,
name: &str,
case_sensitive: bool,
) -> Result<bool, PolarsError>
pub fn has_udf( &self, name: &str, case_sensitive: bool, ) -> Result<bool, PolarsError>
Check if a Rust UDF exists. Returns Err if the registry lock is poisoned.
Sourcepub fn clear(&self) -> Result<(), PolarsError>
pub fn clear(&self) -> Result<(), PolarsError>
Clear all registered UDFs (used by SparkSession.stop()).
Trait Implementations§
Source§impl Clone for UdfRegistry
impl Clone for UdfRegistry
Source§fn clone(&self) -> UdfRegistry
fn clone(&self) -> UdfRegistry
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 Default for UdfRegistry
impl Default for UdfRegistry
Source§fn default() -> UdfRegistry
fn default() -> UdfRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for UdfRegistry
impl RefUnwindSafe for UdfRegistry
impl Send for UdfRegistry
impl Sync for UdfRegistry
impl Unpin for UdfRegistry
impl UnsafeUnpin for UdfRegistry
impl UnwindSafe for UdfRegistry
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more