visibility changes

main
Ziyang Hu 1 year ago
parent 22054f9340
commit 3af821a497

@ -19,6 +19,7 @@ use smartstring::SmartString;
use thiserror::Error;
use crate::data::functions::*;
use crate::data::relation::NullableColType;
use crate::data::symb::Symbol;
use crate::data::value::{DataValue, LARGEST_UTF_CHAR};
use crate::parse::expr::expr2bytecode;
@ -636,6 +637,15 @@ pub struct Op {
pub(crate) inner: fn(&[DataValue]) -> Result<DataValue>,
}
/// Used as `Arc<dyn CustomOp>`
pub trait CustomOp {
fn name(&self) -> &'static str;
fn min_arity(&self) -> usize;
fn vararg(&self) -> bool;
fn return_type(&self) -> NullableColType;
fn call(&self, args: &[DataValue]) -> Result<DataValue>;
}
impl serde::Serialize for &'_ Op {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where

@ -22,9 +22,9 @@ use crate::data::expr::Expr;
use crate::data::value::{DataValue, UuidWrapper, Validity, ValidityTs, Vector};
#[derive(Debug, Clone, Eq, PartialEq, serde_derive::Deserialize, serde_derive::Serialize)]
pub(crate) struct NullableColType {
pub(crate) coltype: ColType,
pub(crate) nullable: bool,
pub struct NullableColType {
pub coltype: ColType,
pub nullable: bool,
}
impl Display for NullableColType {
@ -75,7 +75,7 @@ impl Display for NullableColType {
}
#[derive(Debug, Clone, Eq, PartialEq, serde_derive::Deserialize, serde_derive::Serialize)]
pub(crate) enum ColType {
pub enum ColType {
Any,
Bool,
Int,
@ -96,7 +96,7 @@ pub(crate) enum ColType {
}
#[derive(Debug, Clone, Eq, PartialEq, Hash, serde_derive::Deserialize, serde_derive::Serialize)]
pub(crate) enum VecElementType {
pub enum VecElementType {
F32,
F64,
}

Loading…
Cancel
Save