pub struct FunctionRouter { /* private fields */ }Expand description
Routes function calls to the appropriate handler.
Implementations§
Source§impl FunctionRouter
impl FunctionRouter
Sourcepub fn new(registry: Arc<FunctionRegistry>, db_pool: PgPool) -> Self
pub fn new(registry: Arc<FunctionRegistry>, db_pool: PgPool) -> Self
Create a new function router.
Sourcepub fn with_http_client(
registry: Arc<FunctionRegistry>,
db_pool: PgPool,
http_client: Client,
) -> Self
pub fn with_http_client( registry: Arc<FunctionRegistry>, db_pool: PgPool, http_client: Client, ) -> Self
Create a new function router with a custom HTTP client.
Sourcepub fn with_job_dispatcher(self, dispatcher: Arc<dyn JobDispatch>) -> Self
pub fn with_job_dispatcher(self, dispatcher: Arc<dyn JobDispatch>) -> Self
Set the job dispatcher for this router.
Sourcepub fn with_workflow_dispatcher(
self,
dispatcher: Arc<dyn WorkflowDispatch>,
) -> Self
pub fn with_workflow_dispatcher( self, dispatcher: Arc<dyn WorkflowDispatch>, ) -> Self
Set the workflow dispatcher for this router.
Sourcepub async fn route(
&self,
function_name: &str,
args: Value,
auth: AuthContext,
request: RequestMetadata,
) -> Result<RouteResult>
pub async fn route( &self, function_name: &str, args: Value, auth: AuthContext, request: RequestMetadata, ) -> Result<RouteResult>
Route and execute a function call.
Sourcepub fn get_function_kind(&self, function_name: &str) -> Option<FunctionKind>
pub fn get_function_kind(&self, function_name: &str) -> Option<FunctionKind>
Get the function kind by name.
Sourcepub fn has_function(&self, function_name: &str) -> bool
pub fn has_function(&self, function_name: &str) -> bool
Check if a function exists.
Auto Trait Implementations§
impl !Freeze for FunctionRouter
impl !RefUnwindSafe for FunctionRouter
impl Send for FunctionRouter
impl Sync for FunctionRouter
impl Unpin for FunctionRouter
impl !UnwindSafe for FunctionRouter
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> 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