Skip to main content

Crate sapphire_framework_server_api

Crate sapphire_framework_server_api 

Source
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 and WORKSPACE_CURRENT reports.

Structs§

Ack
The success payload of a method that returns nothing.
ContentParams
Parameters naming a path and the text to put there.
CurrentWorkspace
The workspace a server serves, as WORKSPACE_CURRENT and WORKSPACE_SELECT report it.
DirEntry
One entry of a directory listing.
EmbeddingProgress
How far a workspace’s embedding has got on this host.
EventParams
Parameters of an EVENT notification.
FileSearchResult
One file matching a search.
GrainId
Grain id struct
ListDirResult
Result of LIST_DIR.
PathParams
Parameters naming a path inside the workspace.
ReadResult
Result of READ_FILE.
ReindexResult
Result of REINDEX.
SearchParams
Parameters of SEARCH.
SearchResult
Result of SEARCH.
StatusReport
The typed answer to a status question, shared by the CLI and the IPC server.info response (spec decision 4).
StatusRow
One application-provided line of the status report.
SyncEnableResult
Result of SYNC_ENABLE.
SyncMapParams
Parameters of SYNC_MAP. The mapped directory becomes the current workspace.
SyncStatusResult
Result of SYNC_STATUS.
WorkspaceCurrentResult
Result of WORKSPACE_CURRENT.
WorkspaceInitParams
Parameters of WORKSPACE_INIT.
WorkspaceInitResult
Result of WORKSPACE_INIT.
WorkspaceSelectParams
Parameters of WORKSPACE_SELECT.

Enums§

BackendEvent
Events a server publishes so a client can react without polling.
ManagedBy
How a server process came to exist, as server.info reports it.
SearchMode
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.
SUBSCRIBE
Start receiving EVENT notifications 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_SELECT
Make an existing workspace of this app the current one.
WRITE_FILE
Create or overwrite a text file.