Expand description
What a client says to an application’s server, and how the server answers: the framework’s methods every app server serves, their parameters and their results.
Kept apart from the rest of the framework so that its version moves only when this
API does. An application’s own API crate depends on this one and nothing heavier;
a client that only talks to a server links neither the search stack nor the IPC
transport through it. Its types are plain serde data: the transport is
sapphire-framework-ipc, the typed client IpcBackend in
sapphire-framework-backend.
A server serves one workspace at a time (#215), so no request names one: every
workspace.* and sync.* method acts on the server’s current workspace, which
WORKSPACE_SELECT and WORKSPACE_INIT change, WORKSPACE_MOVE and
WORKSPACE_REMOVE relocate or let go of, and WORKSPACE_CURRENT reports.
Re-exports§
pub use sapphire_bridge_api as bridge;
Structs§
- Ack
- The success payload of a method that returns nothing.
- Content
Params - Parameters naming a path and the text to put there.
- Current
Workspace - The workspace a server serves, as
WORKSPACE_CURRENTandWORKSPACE_SELECTreport it. - DirEntry
- One entry of a directory listing.
- Embedding
Progress - How far a workspace’s embedding has got on this host.
- Event
Params - Parameters of an
EVENTnotification. - File
Search Result - One file matching a search.
- GrainId
- Grain id struct
- List
DirResult - Result of
LIST_DIR. - Path
Params - Parameters naming a path inside the workspace.
- Read
Result - Result of
READ_FILE. - Reindex
Result - Result of
REINDEX. - Release
Info - One published release, as
UpdateStatusreports it. - Search
Params - Parameters of
SEARCH. - Search
Result - Result of
SEARCH. - Status
Report - The typed answer to a status question, shared by the CLI and the IPC
server.inforesponse (spec decision 4). - Status
Row - One application-provided line of the status report.
- Sync
Enable Result - Result of
SYNC_ENABLE. - Sync
MapParams - Parameters of
SYNC_MAP. The mapped directory becomes the current workspace. - Sync
Status Result - Result of
SYNC_STATUS. - Update
Status - The answer to
SERVER_UPDATE: whether a newer release of the running server exists. - Workspace
Current Result - Result of
WORKSPACE_CURRENT. - Workspace
Init Params - Parameters of
WORKSPACE_INIT. - Workspace
Init Result - Result of
WORKSPACE_INIT. - Workspace
Move Params - Parameters of
WORKSPACE_MOVE. The result is theCurrentWorkspaceat its new root. - Workspace
Remove Params - Parameters of
WORKSPACE_REMOVE. The result is anAck; the server has no workspace afterwards. - Workspace
Select Params - Parameters of
WORKSPACE_SELECT.
Enums§
- Backend
Event - Events a server publishes so a client can react without polling.
- Managed
By - How a server process came to exist, as
server.inforeports it. - Search
Mode - Which retrieval strategy a search uses.
- Topology
- How a synced workspace is wired to its peers right now.
Constants§
- API_
VERSION - The version of the app server’s API: the framework’s methods below and their types.
- APPEND_
FILE - Append to a text file.
- DELETE_
FILE - Delete a file.
- EVENT
- Notification carrying one
BackendEvent. - LIST_
DIR - List a directory’s direct children.
- READ_
FILE - Read a text file in full.
- REINDEX
- Rebuild the index from disk.
- SEARCH
- Search the workspace.
- SERVER_
INFO - What the server knows about itself.
- SERVER_
RESTART - Restart the app server in place: it answers
Ack, stops what it serves (HTTP, sync, the update check, open connections), reads its settings again and serves anew on the same endpoint, in the same process. A client reconnects to reach the new server. - SERVER_
UPDATE - What the server last learnt about newer releases of itself:
UpdateStatus. - SUBSCRIBE
- Start receiving
EVENTnotifications for the current workspace, and for whichever workspace is current after a switch. - SYNC_
DISABLE - Stop syncing the current workspace. Files stay.
- SYNC_
ENABLE - Start syncing the current workspace.
- SYNC_
MAP - Place a workspace’s directory, by name or id.
- SYNC_
STATUS - Report the current workspace’s replication state.
- WORKSPACE_
CURRENT - Report the current workspace.
- WORKSPACE_
INIT - Create this app’s workspace home in a directory — the marker and a registry entry — and make it the current workspace.
- WORKSPACE_
MOVE - Move the current workspace’s folder elsewhere on this host, and keep serving it there.
- WORKSPACE_
REMOVE - Stop serving the current workspace, optionally deleting its folder.
- WORKSPACE_
SELECT - Make an existing workspace of this app the current one.
- WRITE_
FILE - Create or overwrite a text file.