pub struct DataFoldHttpServer { /* private fields */ }Expand description
HTTP server for the DataFold node.
DataFoldHttpServer provides a web-based interface for external clients to interact with a DataFold node. It handles HTTP requests and can serve the built React UI, and provides REST API endpoints for schemas, queries, and mutations.
§Features
- Static file serving for the UI
- REST API endpoints for schemas, queries, and mutations
- Sample data management
- One-click loading of sample data
Implementations§
Source§impl DataFoldHttpServer
impl DataFoldHttpServer
Sourcepub async fn new(node: DataFoldNode, bind_address: &str) -> FoldDbResult<Self>
pub async fn new(node: DataFoldNode, bind_address: &str) -> FoldDbResult<Self>
Create a new HTTP server.
This method creates a new HTTP server that listens on the specified address. It uses the provided DataFoldNode to process client requests.
§Arguments
node- The DataFoldNode instance to use for processing requestsbind_address- The address to bind to (e.g., “127.0.0.1:9001”)
§Returns
A FoldDbResult containing the new DataFoldHttpServer instance.
§Errors
Returns a FoldDbError if:
- There is an error starting the HTTP server
Sourcepub async fn run(&self) -> FoldDbResult<()>
pub async fn run(&self) -> FoldDbResult<()>
Run the HTTP server.
This method starts the HTTP server and begins accepting client connections. It can serve the compiled React UI and provides REST API endpoints for schemas, queries, and mutations.
§Returns
A FoldDbResult indicating success or failure.
§Errors
Returns a FoldDbError if:
- There is an error binding to the specified address
- There is an error starting the server
Auto Trait Implementations§
impl Freeze for DataFoldHttpServer
impl !RefUnwindSafe for DataFoldHttpServer
impl Send for DataFoldHttpServer
impl Sync for DataFoldHttpServer
impl Unpin for DataFoldHttpServer
impl !UnwindSafe for DataFoldHttpServer
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
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>
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>
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