Skip to main content

SchemaOnlyFunction

Struct SchemaOnlyFunction 

Source
pub struct SchemaOnlyFunction { /* private fields */ }
Expand description

A function that carries a schema but has no native implementation.

This is used to represent functions declared in inline catalogs that the server sends as part of capabilities negotiation. The client knows the function exists (and its declared return type) but cannot execute it.

Implementations§

Source§

impl SchemaOnlyFunction

Source

pub fn new(name: String, return_type: ReturnType) -> Self

Create a new schema-only function from a runtime String name.

The name is leaked via Box::leak to produce the &'static str required by FunctionImplementation::name. This leak is bounded: inline catalogs are registered exactly once at startup (via MessageProcessor::register_inline_catalog) and never unloaded for the lifetime of the processor, so the leaked memory is proportional to the (small, fixed) set of inline functions a client advertises — it does not grow unboundedly.

Trait Implementations§

Source§

impl FunctionImplementation for SchemaOnlyFunction

Source§

fn name(&self) -> &'static str

The function name as it appears in the catalog.
Source§

fn return_type(&self) -> ReturnType

The return type of this function.
Source§

fn execute( &self, _args: &HashMap<String, Value>, _context: &DataContext<'_>, ) -> Result<Value, A2uiError>

Execute the function with resolved arguments. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.