A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
builtins.h
Go to the documentation of this file.
1/*
2 * Copyright 2026 The A11 Authors
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
41#ifndef A11_ACTIONS_BUILTINS_H_
42#define A11_ACTIONS_BUILTINS_H_
43
44#include <string>
45#include <string_view>
46#include <vector>
47
48#include <absl/base/nullability.h>
49
50#include "a11/actions/action.h"
51#include "a11/actions/schema.h"
52
53namespace a11::actions {
54
56inline constexpr std::string_view kListActionsName = "__list_actions__";
58inline constexpr std::string_view kGetSchemaName = "__get_schema__";
66inline constexpr std::string_view kPingName = "__ping";
67
73
75bool IsBuiltinAction(std::string_view name);
76
78const BuiltinAction* absl_nullable GetBuiltinAction(std::string_view name);
79
81const std::vector<std::string>& BuiltinActionNames();
82
83} // namespace a11::actions
84
85#endif // A11_ACTIONS_BUILTINS_H_
A11's unit of work: the Action and its supporting types.
Schemas describing an action's typed interface and its settings.
std::string name
The name and its colon, which travel together because they always do.
Definition format.cc:49
Definition action.cc:63
const std::vector< std::string > & BuiltinActionNames()
Every builtin's name, sorted.
Definition builtins.cc:279
constexpr std::string_view kPingName
Echoes a value, so a caller can tell A11 from anything holding a port.
Definition builtins.h:66
bool IsBuiltinAction(std::string_view name)
Whether name is a builtin every registry answers for.
Definition builtins.cc:267
constexpr std::string_view kGetSchemaName
Returns one action's schema, or NotFound.
Definition builtins.h:58
const BuiltinAction *absl_nullable GetBuiltinAction(std::string_view name)
The builtin named name, or null.
Definition builtins.cc:271
constexpr std::string_view kListActionsName
Lists the actions a peer serves, with their schemas.
Definition builtins.h:56
std::function< a11::Task(std::shared_ptr< Action >)> ActionHandler
Asynchronous action handler: runs the action, returns an awaitable.
Definition action.h:90
The full typed interface of an action.
Definition schema.h:138
A schema and handler pair the registry resolves without holding.
Definition builtins.h:69
ActionHandler handler
Definition builtins.h:71
ActionSchema schema
Definition builtins.h:70