| Crates.io | arcana-base-server |
| lib.rs | arcana-base-server |
| version | 0.6.0 |
| created_at | 2025-10-21 08:00:11.389595+00 |
| updated_at | 2025-10-21 08:00:11.389595+00 |
| description | Library to help create your own arcana activation server |
| homepage | |
| repository | https://git.dgnum.eu/DGNum/arcana |
| max_upload_size | |
| id | 1893413 |
| size | 63,670 |
Using the arcana-base-server utility, you only have to write a struct and
three functions.
The struct is the state of the activation regarding a host. This struct should
be able to parse a uri (passed as an url::Url instance) to have enough
information to connect to the targeted host.
For example, please look at the arcana-nixos-server/src/host.rs file.
The three functions consists of handler of the requests coming from the arcana client:
apply_function is the function which takes apply requests and process it.build_function is the function which takes build requests and process it.copy_closure_function is the function which takes copy closure requests and
process it.Signatures of the function should be:
pub async fn apply(
target: TargetHost,
tx: tokio::sync::mpsc::Sender<Result<ApplyResponse, Status>>,
request: ApplyRequest,
) -> std::io::Result<()>;
pub async fn build(
target: TargetHost,
tx: tokio::sync::mpsc::Sender<Result<BuildResponse, Status>>,
request: BuildRequest,
) -> std::io::Result<()>;
pub async fn copy_closure(
target: TargetHost,
tx: tokio::sync::mpsc::Sender<Result<CopyClosureResponse, Status>>,
request: CopyClosureRequest,
) -> std::io::Result<()>;
where TargetHost is your struct defined earlier.
Functions takes the state and the request and push responses inside the tx
channel.
For more example, please take a look to the arcana-nixos-server.