Module safe_core::ffi [] [src]

Ffi module; This module provides FFI-bindings to the Client Modules (core, nfs, dns) In the current implementation the allocations made by this crate are managed within the crate itself and is guaranteed that management of such allocations will not be pushed beyond the FFI boundary. This has a 2-fold outcome: firstly, the passing of data is done by filling of the allocations passed by the caller and is caller's responsibility to manage those. For this every function that fills an allocated memory also has a companion function to return the size of data which the caller can call to find out how much space needs to be allocated in the first place. Second and consequently, the caller does not have to bother calling functions within this crate which only serve to free resources allocated by the crate itself. This otherwise would be error prone and cumbersome. Instead the caller can use whatever idiom in his language to manage memory much more naturally and conveniently (eg., RAII idioms etc)

The only exception to the above rule is the obtainment of the client engine itself. The client engine is allocated and managed by the crate. This is necessary because it serves as a context to all operations provided by the crate. Hence the user will obtain the engine on calling any one of the functions to create it and must preserve it for all subsequent operations. When done, to release the resources, drop_client may be called.

Modules

app

Structure representing application registered with the launcher + set of FFI operations on it.

directory_details

Details about directory and its content.

dns

DNS operations.

errors

Errors thrown by the FFI operations

file_details

FFI-enabled types containing details (content and metadata) about a file.

logging

Logging.

low_level_api

Low Level APIs

nfs

Network filesystem operations

session

Session management

string_list

StringList is a FFI-enabled wrapper over vector of strings with a corresponding FFI-enabled API.