pub struct HaystackServer { /* private fields */ }Expand description
Builder for the Haystack HTTP server.
Implementations§
Source§impl HaystackServer
impl HaystackServer
Sourcepub fn new(graph: SharedGraph) -> Self
pub fn new(graph: SharedGraph) -> Self
Create a new server with the given entity graph.
Sourcepub fn with_namespace(self, ns: DefNamespace) -> Self
pub fn with_namespace(self, ns: DefNamespace) -> Self
Set the ontology namespace for def/spec operations.
Sourcepub fn with_auth(self, auth: AuthManager) -> Self
pub fn with_auth(self, auth: AuthManager) -> Self
Set the authentication manager.
Sourcepub fn with_actions(self, actions: ActionRegistry) -> Self
pub fn with_actions(self, actions: ActionRegistry) -> Self
Set the action registry for the invokeAction op.
Sourcepub fn with_router(self, router: Router<SharedState>) -> Self
pub fn with_router(self, router: Router<SharedState>) -> Self
Merge additional routes into the server.
Note: Routes added via with_router() are NOT protected by the built-in
auth middleware. To protect custom routes, apply your own auth layer to the
router before passing it, or use with_authenticated_router() instead.
The router’s routes are merged at the top level, so paths must
include any prefix (e.g. /custom/endpoint).
Sourcepub fn with_authenticated_router(self, router: Router<SharedState>) -> Self
pub fn with_authenticated_router(self, router: Router<SharedState>) -> Self
Merge additional routes that are protected by the built-in auth middleware.
Routes added here go through the same authentication and permission checks as the standard Haystack API endpoints.
Sourcepub fn with_history_provider(self, provider: Box<dyn HistoryProvider>) -> Self
pub fn with_history_provider(self, provider: Box<dyn HistoryProvider>) -> Self
Set the history storage provider (default: in-memory HisStore).