Crate nextcloud_client_api

Source
Expand description

This crate provides an API to the NextCloud linux client. It connects to the socket of the client to interact. The socket is located in the runtime directory, which is defined by the $XDG_RUNTIME_DIR environment variable. If this variable is not available, the creation will fail.

The API is based on the source code published here: https://github.com/nextcloud/desktop/blob/master/src/gui/socketapi/socketapi.h

§Examples

use std::path::Path;
use nextcloud_client_api::Api;

let mut api = Api::new()
    .expect("failed to open API");
let version = api.version()
    .expect("failed to fetch version");
let file_status = api.retrieve_file_status(
        &Path::new("/Nextcloud/Documents/About-Storage-Share.pdf")
    ).expect("failed to retrieve file status");

Structs§

Api
interface object to interact with NextCloud client

Enums§

Error
Extensive error codes for drill down

Type Aliases§

Result
Result of API interactions